Avoid recomputing an inserted instruction's SlotIndex.
authorCameron Zwarich <zwarich@apple.com>
Wed, 20 Feb 2013 06:46:32 +0000 (06:46 +0000)
committerCameron Zwarich <zwarich@apple.com>
Wed, 20 Feb 2013 06:46:32 +0000 (06:46 +0000)
llvm-svn: 175597

llvm/lib/CodeGen/PHIElimination.cpp

index 37e2ee1..061c385 100644 (file)
@@ -306,10 +306,9 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
   // Update LiveIntervals for the new copy or implicit def.
   if (LIS) {
     MachineInstr *NewInstr = prior(AfterPHIsIt);
-    LIS->InsertMachineInstrInMaps(NewInstr);
+    SlotIndex DestCopyIndex = LIS->InsertMachineInstrInMaps(NewInstr);
 
     SlotIndex MBBStartIndex = LIS->getMBBStartIdx(&MBB);
-    SlotIndex DestCopyIndex = LIS->getInstructionIndex(NewInstr);
     if (IncomingReg) {
       // Add the region from the beginning of MBB to the copy instruction to
       // IncomingReg's live interval.