summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-18 22:20:09 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-18 22:20:09 +0000
commit430b6e40abd8af80edae6be25538e49f3642f3d9 (patch)
tree079f17d1d4b01aa013d6329e26e13c0384effec3 /llvm/lib/CodeGen/RegAllocLocal.cpp
parent62713dac1948a41e3c81b845ae51a176ff692635 (diff)
downloadbcm5719-llvm-430b6e40abd8af80edae6be25538e49f3642f3d9.tar.gz
bcm5719-llvm-430b6e40abd8af80edae6be25538e49f3642f3d9.zip
Remember to update VirtRegLastUse when spilling without killing before a call.
llvm-svn: 104074
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLocal.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp
index 8106a36c9b4..321ae12def5 100644
--- a/llvm/lib/CodeGen/RegAllocLocal.cpp
+++ b/llvm/lib/CodeGen/RegAllocLocal.cpp
@@ -301,6 +301,16 @@ void RALocal::storeVirtReg(MachineBasicBlock &MBB,
DEBUG(dbgs() << " to stack slot #" << FrameIndex);
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC, TRI);
++NumStores; // Update statistics
+
+ // Mark the spill instruction as last use if we're not killing the register.
+ if (!isKill) {
+ MachineInstr *Spill = llvm::prior(I);
+ int OpNum = Spill->findRegisterUseOperandIdx(PhysReg);
+ if (OpNum < 0)
+ getVirtRegLastUse(VirtReg) = std::make_pair((MachineInstr*)0, 0);
+ else
+ getVirtRegLastUse(VirtReg) = std::make_pair(Spill, OpNum);
+ }
}
/// spillVirtReg - This method spills the value specified by PhysReg into the
OpenPOWER on IntegriCloud