[llvm-branch-commits] [llvm-branch] r70397 - in /llvm/branches/Apple/Dib: lib/CodeGen/RegAllocLinearScan.cpp test/CodeGen/X86/2009-04-29-LinearScanBug.ll

Bill Wendling isanbard at gmail.com
Wed Apr 29 11:44:37 PDT 2009


Author: void
Date: Wed Apr 29 13:44:37 2009
New Revision: 70397

URL: http://llvm.org/viewvc/llvm-project?rev=70397&view=rev
Log:
--- Merging r70378 into '.':
A    test/CodeGen/X86/2009-04-29-LinearScanBug.ll
U    lib/CodeGen/RegAllocLinearScan.cpp

spillPhysRegAroundRegDefsUses() may have invalidated iterators stored in fixed_
IntervalPtrs. Reset them.

Added:
    llvm/branches/Apple/Dib/test/CodeGen/X86/2009-04-29-LinearScanBug.ll
      - copied unchanged from r70378, llvm/trunk/test/CodeGen/X86/2009-04-29-LinearScanBug.ll
Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp?rev=70397&r1=70396&r2=70397&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp Wed Apr 29 13:44:37 2009
@@ -978,6 +978,15 @@
         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 {





More information about the llvm-branch-commits mailing list