summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-07-25 21:07:13 +0000
committerOwen Anderson <resistor@mac.com>2008-07-25 21:07:13 +0000
commit88499a35036cf5a5351b8f50dbc061348f308b53 (patch)
treeb1ecdac4b50788c060d87c11c2c31f4064748f60 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parente8f7bdc5cfff48cb23f847f13a2ff6b38579764d (diff)
downloadbcm5719-llvm-88499a35036cf5a5351b8f50dbc061348f308b53.tar.gz
bcm5719-llvm-88499a35036cf5a5351b8f50dbc061348f308b53.zip
Properly remap live ranges whose end indices are the end of the function.
llvm-svn: 54061
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 9bd00372445..833cb95eb9f 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -168,8 +168,12 @@ void LiveIntervals::computeNumbering() {
LI->end = getMBBEndIdx(J->second) + 1;
} else {
unsigned idx = index;
- while (!OldI2MI[index]) ++index;
- LI->end = mi2iMap_[OldI2MI[index]] + (idx == index ? offset : 0);
+ while (index < OldI2MI.size() && !OldI2MI[index]) ++index;
+
+ if (index != OldI2MI.size())
+ LI->end = mi2iMap_[OldI2MI[index]] + (idx == index ? offset : 0);
+ else
+ LI->end = InstrSlots::NUM * i2miMap_.size();
}
// Remap the VNInfo def index, which works the same as the
@@ -208,8 +212,13 @@ void LiveIntervals::computeNumbering() {
} else {
unsigned idx = index;
while (!OldI2MI[index]) ++index;
- vni->kills[i] = mi2iMap_[OldI2MI[index]] +
- (idx == index ? offset : 0);
+ while (index < OldI2MI.size() && !OldI2MI[index]) ++index;
+
+ if (index != OldI2MI.size())
+ vni->kills[i] = mi2iMap_[OldI2MI[index]] +
+ (idx == index ? offset : 0);
+ else
+ vni->kills[i] = InstrSlots::NUM * i2miMap_.size();
}
}
}
OpenPOWER on IntegriCloud