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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175597 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PHIElimination.cpp

index 37e2ee1fae16f463fe3400c05350e53afd1a0de3..061c385765c8853458696302c75783b93ad73ad7 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.