aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-02-29 18:52:01 +0000
committerBill Wendling <isanbard@gmail.com>2008-02-29 18:52:01 +0000
commit97e3c01eb4ee6afff602ad11a2f2788ed7c83580 (patch)
tree56f692cb9af104c4c742b3592628c87ce7615bc9 /lib/CodeGen/RegAllocLocal.cpp
parent4f658e9e4b2c7c25779c304a90f460615d35e555 (diff)
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
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 99fc6c9028..9e274543cf 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -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;
}