diff options
author | Andrew Trick <atrick@apple.com> | 2012-03-21 04:12:16 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-03-21 04:12:16 +0000 |
commit | f70af52a8fc735a84aa8d63b84dd56abd0b9e77c (patch) | |
tree | c098735f17c01031258411d0da80fafdccf4ff0e /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | aad37f1925621cb1f9f2bb2c899b517bf1df344a (diff) |
misched: fix LiveInterval update for bottom-up scheduling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 1019ad2594..3ade66097c 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1049,9 +1049,19 @@ public: bool hasRegMaskOp = false; collectRanges(MI, Entering, Internal, Exiting, hasRegMaskOp, OldIdx); - moveAllEnteringFrom(OldIdx, Entering); - moveAllInternalFrom(OldIdx, Internal); - moveAllExitingFrom(OldIdx, Exiting); + // To keep the LiveRanges valid within an interval, move the ranges closest + // to the destination first. This prevents ranges from overlapping, to that + // APIs like removeRange still work. + if (NewIdx < OldIdx) { + moveAllEnteringFrom(OldIdx, Entering); + moveAllInternalFrom(OldIdx, Internal); + moveAllExitingFrom(OldIdx, Exiting); + } + else { + moveAllExitingFrom(OldIdx, Exiting); + moveAllInternalFrom(OldIdx, Internal); + moveAllEnteringFrom(OldIdx, Entering); + } if (hasRegMaskOp) updateRegMaskSlots(OldIdx); |