aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-04-29 07:16:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-04-29 07:16:34 +0000
commit96f3fd9a7fa709bc1ae738f6f6f82b73d4a93628 (patch)
tree9c0fd799e1c95da65d58616145f81aad86de09d0 /lib/CodeGen/RegAllocLinearScan.cpp
parent3a33f4903a31d35db13fb2846c5fcd0feb623888 (diff)
downloadexternal_llvm-96f3fd9a7fa709bc1ae738f6f6f82b73d4a93628.zip
external_llvm-96f3fd9a7fa709bc1ae738f6f6f82b73d4a93628.tar.gz
external_llvm-96f3fd9a7fa709bc1ae738f6f6f82b73d4a93628.tar.bz2
spillPhysRegAroundRegDefsUses() may have invalidated iterators stored in fixed_ IntervalPtrs. Reset them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index 2ed902c..17aec81 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -978,6 +978,15 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
li_->getApproximateInstructionCount(*cur) == 0) {
// Spill a physical register around defs and uses.
if (li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_)) {
+ // spillPhysRegAroundRegDefsUses may have invalidated iterator stored
+ // in fixed_. Reset them.
+ for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
+ IntervalPtr &IP = fixed_[i];
+ LiveInterval *I = IP.first;
+ if (I->reg == minReg || tri_->isSubRegister(minReg, I->reg))
+ IP.second = I->advanceTo(I->begin(), StartPosition);
+ }
+
DowngradedRegs.clear();
assignRegOrStackSlotAtInterval(cur);
} else {