summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-20 22:10:00 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-20 22:10:00 +0000
commitc5b6135fb55362f5c052625043ebf3286f799f86 (patch)
treec3fad459126250734fb11e96a39a3462a3cad524 /lib/CodeGen/LiveIntervalAnalysis.cpp
parent0e827ebc783ded58c11aeb0d66bed43e214de2de (diff)
downloadllvm-c5b6135fb55362f5c052625043ebf3286f799f86.tar.gz
llvm-c5b6135fb55362f5c052625043ebf3286f799f86.tar.bz2
llvm-c5b6135fb55362f5c052625043ebf3286f799f86.tar.xz
Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index e07922b54c..a716e8bbab 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1038,6 +1038,13 @@ LiveIntervals::repairIntervalsInRange(MachineBasicBlock *MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
ArrayRef<unsigned> OrigRegs) {
+ // Find anchor points, which are at the beginning/end of blocks or at
+ // instructions that already have indexes.
+ while (Begin != MBB->begin() && !Indexes->hasIndex(Begin))
+ --Begin;
+ while (End != MBB->end() && !Indexes->hasIndex(End))
+ ++End;
+
SlotIndex endIdx;
if (End == MBB->end())
endIdx = getMBBEndIdx(MBB).getPrevSlot();