[llvm-commits] [llvm] r51876 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Owen Anderson resistor at mac.com
Mon Jun 2 10:36:36 PDT 2008


Author: resistor
Date: Mon Jun  2 12:36:36 2008
New Revision: 51876

URL: http://llvm.org/viewvc/llvm-project?rev=51876&view=rev
Log:
Correctly handle removed instructions at the beginning of MBBs when renumbering.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=51876&r1=51875&r2=51876&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Jun  2 12:36:36 2008
@@ -128,13 +128,11 @@
             i++;
           } while (!newInstr);
           
-          MachineInstr* preceding = i2miMap_[(mi2iMap_[newInstr] - 
-                                    InstrSlots::NUM) / InstrSlots::NUM];
-          if (preceding->getParent() == newInstr->getParent() &&
-              preceding->modifiesRegister(I->second.reg))
-            LI->start = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
-          else
+          if (mi2iMap_[newInstr] ==
+              MBB2IdxMap[newInstr->getParent()->getNumber()].first)
             LI->start = mi2iMap_[newInstr];
+          else
+            LI->start = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
         }
         
         // Remap the ending index in the same way that we remapped the start,
@@ -172,13 +170,11 @@
             i++;
           } while (!newInstr);
           
-          MachineInstr* preceding = i2miMap_[(mi2iMap_[newInstr] - 
-                                    InstrSlots::NUM) / InstrSlots::NUM];
-          if (preceding->getParent() == newInstr->getParent() &&
-              preceding->modifiesRegister(I->second.reg))
-            vni->def = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
-          else
+          if (mi2iMap_[newInstr] ==
+              MBB2IdxMap[newInstr->getParent()->getNumber()].first)
             vni->def = mi2iMap_[newInstr];
+          else
+            vni->def = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
         }
         
         // Remap the VNInfo kill indices, which works the same as





More information about the llvm-commits mailing list