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:
Jakob Stoklund Olesen
2010-05-18 22:20:09 +00:00
parent f8c1ef0510
commit dcf7708ad9
2 changed files with 47 additions and 0 deletions

View File

@@ -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