diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-18 22:20:09 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-18 22:20:09 +0000 |
commit | dcf7708ad9ed9e320ab814e7fa8512e4854cc637 (patch) | |
tree | dc935f6ea7d2534686354fb977776f71e829714c /lib/CodeGen/RegAllocLocal.cpp | |
parent | f8c1ef0510801867ffcdd055d4ee361d3ad6ea40 (diff) |
Remember to update VirtRegLastUse when spilling without killing before a call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 8106a36c9b..321ae12def 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/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 |