diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-04-29 07:16:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-04-29 07:16:34 +0000 |
commit | 9cce299cc8d504b5d2fff5e24f72ea5ef751b5b1 (patch) | |
tree | 53bb532c798205ea09ddebc9722e6c69bdc12c6b /llvm/lib/CodeGen/RegAllocLinearScan.cpp | |
parent | e6d2e627dae94c95f6fb994620ca145353d36be6 (diff) | |
download | bcm5719-llvm-9cce299cc8d504b5d2fff5e24f72ea5ef751b5b1.tar.gz bcm5719-llvm-9cce299cc8d504b5d2fff5e24f72ea5ef751b5b1.zip |
spillPhysRegAroundRegDefsUses() may have invalidated iterators stored in fixed_ IntervalPtrs. Reset them.
llvm-svn: 70378
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocLinearScan.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 2ed902cf553..17aec812948 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/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 { |