aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-03-21 04:12:01 +0000
committerAndrew Trick <atrick@apple.com>2012-03-21 04:12:01 +0000
commite0b51ab8d3484b5b526a942f26c4db8082fed1e1 (patch)
treeb45b91417ebfd57d77314a5dca781a4e2c535a43
parent6244b518880842f2c15200ee041e06799e4cc779 (diff)
misched: fix LI update for bottom-up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153158 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 70ed1c398b..1019ad2594 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1319,8 +1319,14 @@ private:
void moveEnteringDownFrom(SlotIndex OldIdx, IntRangePair& P) {
LiveInterval* LI = P.first;
LiveRange* LR = P.second;
+ // Extend the LiveRange if NewIdx is past the end.
if (NewIdx > LR->end) {
- moveKillFlags(LI->reg, LR->end, NewIdx);
+ // Move kill flags if OldIdx was not originally the end
+ // (otherwise LR->end points to an invalid slot).
+ if (LR->end.getRegSlot() != OldIdx.getRegSlot()) {
+ assert(LR->end > OldIdx && "LiveRange does not cover original slot");
+ moveKillFlags(LI->reg, LR->end, NewIdx);
+ }
LR->end = NewIdx.getRegSlot();
}
}