aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commitcaad7e10c1edbd0bff9d54351f174a497998232e (patch)
tree97a9b200db78b3a1c6dfb142bc56c1da2b5404f9 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent8e7dc068c9237822867fb60f96da1494999de75e (diff)
downloadllvm-caad7e10c1edbd0bff9d54351f174a497998232e.zip
llvm-caad7e10c1edbd0bff9d54351f174a497998232e.tar.gz
llvm-caad7e10c1edbd0bff9d54351f174a497998232e.tar.bz2
Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically. llvm-svn: 175673
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index e07922b..a716e8b 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/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();