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

Owen Anderson resistor at mac.com
Sun Jun 15 23:18:41 PDT 2008


Author: resistor
Date: Mon Jun 16 01:18:41 2008
New Revision: 52300

URL: http://llvm.org/viewvc/llvm-project?rev=52300&view=rev
Log:
Assign indices to empty basic blocks.  This will be necessary for StrongPHIElimination in the near future.

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=52300&r1=52299&r2=52300&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Jun 16 01:18:41 2008
@@ -100,11 +100,14 @@
       i2miMap_.push_back(I);
       MIIndex += InstrSlots::NUM;
     }
-
+    
+    if (StartIdx == MIIndex) {
+      // Empty MBB
+      MIIndex += InstrSlots::NUM;
+      i2miMap_.push_back(0);
+    }
     // Set the MBB2IdxMap entry for this MBB.
-    MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
-      ? std::make_pair(StartIdx, StartIdx)  // Empty MBB
-      : std::make_pair(StartIdx, MIIndex - 1);
+    MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1);
     Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
   }
   std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
@@ -661,6 +664,8 @@
       
       MIIndex += InstrSlots::NUM;
     }
+    
+    if (MBB->begin() == miEnd) MIIndex += InstrSlots::NUM; // Empty MBB
   }
 }
 





More information about the llvm-commits mailing list