Correct fix for a crasher on functions with live in values
authorChris Lattner <sabre@nondot.org>
Mon, 4 Sep 2006 18:27:40 +0000 (18:27 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Sep 2006 18:27:40 +0000 (18:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30099 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 12b967ba682246b71f5bb6e52986c892a3e1a16f..5bc03bc9576c4dfd863bc04d2dbb9769912e6316 100644 (file)
@@ -613,15 +613,17 @@ void LiveIntervals::computeIntervals() {
     DEBUG(std::cerr << ((Value*)mbb->getBasicBlock())->getName() << ":\n");
 
     MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
-    if (IgnoreFirstInstr) { ++mi; IgnoreFirstInstr = false; }
+    if (IgnoreFirstInstr) {
+      ++mi;
+      IgnoreFirstInstr = false;
+      MIIndex += InstrSlots::NUM;
+    }
+    
     for (; mi != miEnd; ++mi) {
       const TargetInstrDescriptor& tid =
         tm_->getInstrInfo()->get(mi->getOpcode());
       DEBUG(std::cerr << MIIndex << "\t" << *mi);
 
-      // FIXME: Why is  this needed?
-      MIIndex = getInstructionIndex(mi);
-      
       // handle implicit defs
       if (tid.ImplicitDefs) {
         for (const unsigned* id = tid.ImplicitDefs; *id; ++id)