mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Add a big assert making sure 2 address instructions are formed right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5057 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -379,6 +379,12 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
if (TM.getInstrInfo().isTwoAddrInstr(MI->getOpcode()) && i == 0) {
|
if (TM.getInstrInfo().isTwoAddrInstr(MI->getOpcode()) && i == 0) {
|
||||||
// must be same register number as the first operand
|
// must be same register number as the first operand
|
||||||
// This maps a = b + c into b += c, and saves b into a's spot
|
// This maps a = b + c into b += c, and saves b into a's spot
|
||||||
|
assert(MI->getOperand(1).isRegister() &&
|
||||||
|
MI->getOperand(1).getAllocatedRegNum() &&
|
||||||
|
MF->getRegClass(virtualReg) ==
|
||||||
|
PhysRegClasses[MI->getOperand(1).getAllocatedRegNum()] &&
|
||||||
|
"Two address instruction invalid!");
|
||||||
|
|
||||||
physReg = MI->getOperand(1).getAllocatedRegNum();
|
physReg = MI->getOperand(1).getAllocatedRegNum();
|
||||||
} else {
|
} else {
|
||||||
physReg = getFreeReg(virtualReg);
|
physReg = getFreeReg(virtualReg);
|
||||||
|
Reference in New Issue
Block a user