[llvm-commits] [llvm] r156778 - /llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon May 14 14:30:58 PDT 2012
Author: stoklund
Date: Mon May 14 16:30:58 2012
New Revision: 156778
URL: http://llvm.org/viewvc/llvm-project?rev=156778&view=rev
Log:
Don't access MO reference after invalidating operand list.
This should unbreak llvm-x86_64-linux.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=156778&r1=156777&r2=156778&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon May 14 16:30:58 2012
@@ -659,9 +659,10 @@
// 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 @@
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
More information about the llvm-commits
mailing list