diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-18 23:41:04 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-18 23:41:04 +0000 |
commit | a57c57067d158cf48d22ab3fd77c87ede1d7b978 (patch) | |
tree | 39628ddd077457a47bfb496eacc9db8eb91041ed /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 3bab3d21f92eca5c1caa83b2b4806d4bcffe5d3d (diff) | |
download | bcm5719-llvm-a57c57067d158cf48d22ab3fd77c87ede1d7b978.tar.gz bcm5719-llvm-a57c57067d158cf48d22ab3fd77c87ede1d7b978.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index ae090f58ec6..53d74fc2245 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1608,7 +1608,7 @@ std::vector<LiveInterval*> LiveIntervals:: addIntervalsForSpillsFast(const LiveInterval &li, const MachineLoopInfo *loopInfo, VirtRegMap &vrm, float& SSWeight) { - vrm.assignVirt2StackSlot(li.reg); + unsigned slot = vrm.assignVirt2StackSlot(li.reg); std::vector<LiveInterval*> added; @@ -1631,9 +1631,13 @@ addIntervalsForSpillsFast(const LiveInterval &li, // Create a new virtual register for the spill interval. MachineOperand& MO = RI.getOperand(); unsigned NewVReg = 0; + bool newInt = false; if (!VRegMap.count(MO.getParent())) { VRegMap[MO.getParent()] = NewVReg = mri_->createVirtualRegister(rc); vrm.grow(); + vrm.assignVirt2StackSlot(NewVReg, slot); + + newInt = true; } else NewVReg = VRegMap[MO.getParent()]; @@ -1666,8 +1670,9 @@ addIntervalsForSpillsFast(const LiveInterval &li, DOUT << " +" << LR; nI.addRange(LR); } - - added.push_back(&nI); + + if (newInt) + added.push_back(&nI); DOUT << "\t\t\t\tadded new interval: "; DEBUG(nI.dump()); |