summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-15 21:02:20 +0000
committerChris Lattner <sabre@nondot.org>2002-12-15 21:02:20 +0000
commit2979a859846137ef534573db757d2fdd33b36e78 (patch)
tree591bdbae7c9848efb16ae161147865ea2fcf9db4 /llvm/lib/CodeGen/RegAllocSimple.cpp
parent22213f00277389225489424deaabfc71535112d9 (diff)
downloadbcm5719-llvm-2979a859846137ef534573db757d2fdd33b36e78.tar.gz
bcm5719-llvm-2979a859846137ef534573db757d2fdd33b36e78.zip
Add a big assert making sure 2 address instructions are formed right
llvm-svn: 5057
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocSimple.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocSimple.cpp b/llvm/lib/CodeGen/RegAllocSimple.cpp
index 97b42b0307a..17b1044c5ce 100644
--- a/llvm/lib/CodeGen/RegAllocSimple.cpp
+++ b/llvm/lib/CodeGen/RegAllocSimple.cpp
@@ -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);
OpenPOWER on IntegriCloud