diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-14 21:30:58 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-14 21:30:58 +0000 |
commit | 6565a709702995fa8a5e659269d6cda134383be7 (patch) | |
tree | 44024e60415b5790d807b8cdc8cf807ed35364be /lib/CodeGen/RegAllocFast.cpp | |
parent | 4d10829e1296b7aea0455e000fc318b147182c1c (diff) |
Don't access MO reference after invalidating operand list.
This should unbreak llvm-x86_64-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocFast.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp index 15485b13da..b383222151 100644 --- a/lib/CodeGen/RegAllocFast.cpp +++ b/lib/CodeGen/RegAllocFast.cpp @@ -659,9 +659,10 @@ RAFast::reloadVirtReg(MachineInstr *MI, unsigned OpNum, // Return true if the operand kills its register. bool RAFast::setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg) { MachineOperand &MO = MI->getOperand(OpNum); + bool Dead = MO.isDead(); if (!MO.getSubReg()) { MO.setReg(PhysReg); - return MO.isKill() || MO.isDead(); + return MO.isKill() || Dead; } // Handle subregister index. @@ -680,7 +681,7 @@ bool RAFast::setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg) { if (MO.isDef() && MO.isUndef()) MI->addRegisterDefined(PhysReg, TRI); - return MO.isDead(); + return Dead; } // Handle special instruction operand like early clobbers and tied ops when |