mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 06:27:16 +00:00
Add a big assert making sure 2 address instructions are formed right
llvm-svn: 5057
This commit is contained in:
parent
c3be436a6a
commit
da3e75b117
@ -379,6 +379,12 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
if (TM.getInstrInfo().isTwoAddrInstr(MI->getOpcode()) && i == 0) {
|
||||
// must be same register number as the first operand
|
||||
// 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();
|
||||
} else {
|
||||
physReg = getFreeReg(virtualReg);
|
||||
|
Loading…
Reference in New Issue
Block a user