Mapping of physregs can make it so that the designated and input physregs are

the same.  In this case, don't emit a noop copy.

llvm-svn: 28008
This commit is contained in:
Chris Lattner 2006-04-28 04:43:18 +00:00
parent e63d808b6e
commit 79c50d96c9
1 changed files with 13 additions and 0 deletions

View File

@ -611,6 +611,19 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
DesignatedReg = ReusedOperands.GetRegForReload(DesignatedReg, &MI, DesignatedReg = ReusedOperands.GetRegForReload(DesignatedReg, &MI,
Spills, MaybeDeadStores); Spills, MaybeDeadStores);
// If the mapped designated register is actually the physreg we have
// incoming, we don't need to inserted a dead copy.
if (DesignatedReg == PhysReg) {
// If this stack slot value is already available, reuse it!
DEBUG(std::cerr << "Reusing SS#" << StackSlot << " from physreg "
<< MRI->getName(PhysReg) << " for vreg"
<< VirtReg
<< " instead of reloading into same physreg.\n");
MI.SetMachineOperandReg(i, PhysReg);
++NumReused;
continue;
}
const TargetRegisterClass* RC = const TargetRegisterClass* RC =
MBB.getParent()->getSSARegMap()->getRegClass(VirtReg); MBB.getParent()->getSSARegMap()->getRegClass(VirtReg);