[llvm-commits] [llvm] r125137 - /llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Feb 8 15:26:48 PST 2011


Author: stoklund
Date: Tue Feb  8 17:26:48 2011
New Revision: 125137

URL: http://llvm.org/viewvc/llvm-project?rev=125137&view=rev
Log:
Fix one more case of splitting after the last split point.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=125137&r1=125136&r2=125137&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Tue Feb  8 17:26:48 2011
@@ -746,8 +746,7 @@
       continue;
     }
 
-    if (IP.second.getBoundaryIndex() < BI.LastUse &&
-        IP.second.getBoundaryIndex() <= BI.LastSplitPoint) {
+    if (IP.second.getBoundaryIndex() < BI.LastUse) {
       // There are interference-free uses at the end of the block.
       // Find the first use that can get the live-out register.
       SmallVectorImpl<SlotIndex>::const_iterator UI =
@@ -755,13 +754,16 @@
                          IP.second.getBoundaryIndex());
       assert(UI != SA->UseSlots.end() && "Couldn't find last use");
       SlotIndex Use = *UI;
-      DEBUG(dbgs() << ", free use at " << Use << ".\n");
       assert(Use <= BI.LastUse && "Couldn't find last use");
-      SlotIndex SegStart = SE.enterIntvBefore(Use);
-      assert(SegStart >= IP.second && "Couldn't avoid interference");
-      assert(SegStart < BI.LastSplitPoint && "Impossible split point");
-      SE.useIntv(SegStart, Stop);
-      continue;
+      // Only attempt a split befroe the last split point.
+      if (Use.getBaseIndex() <= BI.LastSplitPoint) {
+        DEBUG(dbgs() << ", free use at " << Use << ".\n");
+        SlotIndex SegStart = SE.enterIntvBefore(Use);
+        assert(SegStart >= IP.second && "Couldn't avoid interference");
+        assert(SegStart < BI.LastSplitPoint && "Impossible split point");
+        SE.useIntv(SegStart, Stop);
+        continue;
+      }
     }
 
     // Interference is after the last use.





More information about the llvm-commits mailing list