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 | 430b6e40abd8af80edae6be25538e49f3642f3d9 (patch) | |
| tree | 079f17d1d4b01aa013d6329e26e13c0384effec3 /llvm/lib/CodeGen/RegAllocLocal.cpp | |
| parent | 62713dac1948a41e3c81b845ae51a176ff692635 (diff) | |
| download | bcm5719-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.cpp | 10 |
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 |

