summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-10-18 05:18:55 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-10-18 05:18:55 +0000
commitac4e70d946d93c010baff645ab7bc04048d63116 (patch)
tree759c34bef33672c6639bd365d031e1984a9d6934 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent43a9d7f3f04464ded1d4f94ddf2630fd5a5aec76 (diff)
downloadbcm5719-llvm-ac4e70d946d93c010baff645ab7bc04048d63116.tar.gz
bcm5719-llvm-ac4e70d946d93c010baff645ab7bc04048d63116.zip
When creating intervals, leave min(1, numdefs) holes after each instruction.
llvm-svn: 57765
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index ff247ad4597..1304659833d 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -130,9 +130,13 @@ void LiveIntervals::computeNumbering() {
MIIndex += InstrSlots::NUM;
FunctionSize++;
- // Insert an empty slot after every instruction.
- MIIndex += InstrSlots::NUM;
- i2miMap_.push_back(0);
+ // Insert min(1, numdefs) empty slots after every instruction.
+ unsigned Slots = I->getDesc().getNumDefs();
+ if (Slots == 0)
+ Slots = 1;
+ MIIndex += InstrSlots::NUM * Slots;
+ while (Slots--)
+ i2miMap_.push_back(0);
}
// Set the MBB2IdxMap entry for this MBB.
@@ -732,8 +736,12 @@ void LiveIntervals::computeIntervals() {
handleRegisterDef(MBB, MI, MIIndex, MO, i);
}
}
-
- MIIndex += InstrSlots::NUM;
+
+ // Skip over the empty slots after each instruction.
+ unsigned Slots = MI->getDesc().getNumDefs();
+ if (Slots == 0)
+ Slots = 1;
+ MIIndex += InstrSlots::NUM * Slots;
// Skip over empty indices.
while (MIIndex / InstrSlots::NUM < i2miMap_.size() &&
OpenPOWER on IntegriCloud