Fix a few more bugs:

1) Assign stack slots to new temporaries.
  2) Don't insert an interval into the return vector more than once.

llvm-svn: 54956
This commit is contained in:
Owen Anderson 2008-08-18 23:41:04 +00:00
parent 3bab3d21f9
commit a57c57067d
1 changed files with 8 additions and 3 deletions

View File

@ -1608,7 +1608,7 @@ std::vector<LiveInterval*> LiveIntervals::
addIntervalsForSpillsFast(const LiveInterval &li, addIntervalsForSpillsFast(const LiveInterval &li,
const MachineLoopInfo *loopInfo, const MachineLoopInfo *loopInfo,
VirtRegMap &vrm, float& SSWeight) { VirtRegMap &vrm, float& SSWeight) {
vrm.assignVirt2StackSlot(li.reg); unsigned slot = vrm.assignVirt2StackSlot(li.reg);
std::vector<LiveInterval*> added; std::vector<LiveInterval*> added;
@ -1631,9 +1631,13 @@ addIntervalsForSpillsFast(const LiveInterval &li,
// Create a new virtual register for the spill interval. // Create a new virtual register for the spill interval.
MachineOperand& MO = RI.getOperand(); MachineOperand& MO = RI.getOperand();
unsigned NewVReg = 0; unsigned NewVReg = 0;
bool newInt = false;
if (!VRegMap.count(MO.getParent())) { if (!VRegMap.count(MO.getParent())) {
VRegMap[MO.getParent()] = NewVReg = mri_->createVirtualRegister(rc); VRegMap[MO.getParent()] = NewVReg = mri_->createVirtualRegister(rc);
vrm.grow(); vrm.grow();
vrm.assignVirt2StackSlot(NewVReg, slot);
newInt = true;
} else } else
NewVReg = VRegMap[MO.getParent()]; NewVReg = VRegMap[MO.getParent()];
@ -1667,6 +1671,7 @@ addIntervalsForSpillsFast(const LiveInterval &li,
nI.addRange(LR); nI.addRange(LR);
} }
if (newInt)
added.push_back(&nI); added.push_back(&nI);
DOUT << "\t\t\t\tadded new interval: "; DOUT << "\t\t\t\tadded new interval: ";