Simplify using the new leaveIntvBefore()
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 9 Feb 2011 23:33:02 +0000 (23:33 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 9 Feb 2011 23:33:02 +0000 (23:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocGreedy.cpp

index 1529545b86c5f169c3e83d0b67b17059bc2b7cf8..f8b3ea792d641d801e6ed098fad145e841bd9903 100644 (file)
@@ -714,19 +714,8 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
         // indirect jump.
         DEBUG(dbgs() << ", uses at " << BI.LastUse << " after split point "
                      << BI.LastSplitPoint << ", stack-out.\n");
-        SlotIndex SegEnd;
-        // Find the last real instruction before the split point.
-        MachineBasicBlock::iterator SplitI =
-          LIS->getInstructionFromIndex(BI.LastSplitPoint);
-        MachineBasicBlock::iterator I = SplitI, B = BI.MBB->begin();
-        while (I != B && (--I)->isDebugValue())
-          ;
-        if (I == SplitI)
-          SegEnd = SE.leaveIntvAtTop(*BI.MBB);
-        else {
-          SegEnd = SE.leaveIntvAfter(LIS->getInstructionIndex(I));
-          SE.useIntv(Start, SegEnd);
-        }
+        SlotIndex SegEnd = SE.leaveIntvBefore(BI.LastSplitPoint);
+        SE.useIntv(Start, SegEnd);
         // Run a double interval from the split to the last use.
         // This makes it possible to spill the complement without affecting the
         // indirect branch.