Fetch the starting index of the block when assigning intervals. This gets live-in...
authorOwen Anderson <resistor@mac.com>
Sun, 21 Sep 2008 20:43:24 +0000 (20:43 +0000)
committerOwen Anderson <resistor@mac.com>
Sun, 21 Sep 2008 20:43:24 +0000 (20:43 +0000)
correct in the presence of things like EH labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56410 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 2a23d492c7eb237e130aa447513e22941e22dee2..e0ff198056f24beca314d50ec0ae51bae9847db2 100644 (file)
@@ -678,12 +678,12 @@ void LiveIntervals::computeIntervals() {
   DOUT << "********** COMPUTING LIVE INTERVALS **********\n"
        << "********** Function: "
        << ((Value*)mf_->getFunction())->getName() << '\n';
-  // Track the index of the current machine instr.
-  unsigned MIIndex = 0;
   
   for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end();
        MBBI != E; ++MBBI) {
     MachineBasicBlock *MBB = MBBI;
+    // Track the index of the current machine instr.
+    unsigned MIIndex = getMBBStartIdx(MBB);
     DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n";
 
     MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end();