aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-08-18 23:41:04 +0000
committerOwen Anderson <resistor@mac.com>2008-08-18 23:41:04 +0000
commit1719731d3d8ab6a986d67912f35daaad4f6910db (patch)
treecb64b2f3e221eb0e515ee279a08191db5a919be5 /lib/CodeGen/LiveIntervalAnalysis.cpp
parentcd7ab05c3782940f4540d94e0f510dc46e710c91 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index ae090f58ec..53d74fc224 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/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());