mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 17:24:57 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user