If we reload a virtual register that's already been assigned, we want to mark

that instruction as its "last use". This fixes PR1925.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47758 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2008-02-29 18:52:01 +00:00
parent 4f658e9e4b
commit 97e3c01eb4
2 changed files with 252 additions and 1 deletions
+2 -1
View File
@@ -480,8 +480,9 @@ MachineInstr *RALocal::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
// If the virtual register is already available, just update the instruction
// and return.
if (unsigned PR = getVirt2PhysRegMapSlot(VirtReg)) {
MarkPhysRegRecentlyUsed(PR); // Already have this value available!
MarkPhysRegRecentlyUsed(PR); // Already have this value available!
MI->getOperand(OpNum).setReg(PR); // Assign the input register
getVirtRegLastUse(VirtReg) = std::make_pair(MI, OpNum);
return MI;
}