Make LiveIntervals::handleMove() bundle aware.
[oota-llvm.git] / lib / CodeGen / LiveIntervalAnalysis.cpp
index a8aa21a96aea6814a508e7c3b648d6f3d840f3c6..0bf47322ba10d2e392317d0120d74d31279a659f 100644 (file)
@@ -963,13 +963,15 @@ static void handleMoveUses(const MachineBasicBlock *mbb,
   }
 }
 
-void LiveIntervals::handleMove(MachineInstr *mi) {
+
+
+void LiveIntervals::handleMove(MachineInstr* mi) {
   SlotIndex origIdx = indexes_->getInstructionIndex(mi);
   indexes_->removeMachineInstrFromMaps(mi);
-  SlotIndex miIdx = indexes_->insertMachineInstrInMaps(mi);
-
+  SlotIndex miIdx = mi->isInsideBundle() ?
+                     indexes_->getInstructionIndex(mi->getBundleStart()) :
+                     indexes_->insertMachineInstrInMaps(mi);
   MachineBasicBlock* mbb = mi->getParent();
-  
   assert(getMBBStartIdx(mbb) <= origIdx && origIdx < getMBBEndIdx(mbb) &&
          "Cannot handle moves across basic block boundaries.");
   assert(!mi->isBundled() && "Can't handle bundled instructions yet.");