summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-14 21:30:58 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-14 21:30:58 +0000
commita13fd12872adced4a483faeab7d5c13c00dc76f4 (patch)
tree7fef66e63255c8ed4f6a9b31e3db492ca63dac13 /llvm/lib/CodeGen
parentdc2e0cd44a81c546aacba772d524f8af98b00f93 (diff)
downloadbcm5719-llvm-a13fd12872adced4a483faeab7d5c13c00dc76f4.tar.gz
bcm5719-llvm-a13fd12872adced4a483faeab7d5c13c00dc76f4.zip
Don't access MO reference after invalidating operand list.
This should unbreak llvm-x86_64-linux. llvm-svn: 156778
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocFast.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index 15485b13dad..b3832221514 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud