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

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jan 19 15:14:56 PST 2011


Author: stoklund
Date: Wed Jan 19 17:14:56 2011
New Revision: 123858

URL: http://llvm.org/viewvc/llvm-project?rev=123858&view=rev
Log:
Don't accidentally leave small gaps in the live ranges when leaving the active
interval after an instruction. The leaveIntvAfter() method only adds liveness
from the instruction's boundary index to the inserted copy.

Ideally, SplitKit should be smarter about this, perhaps by combining useIntv()
and leaveIntvAfter() into one method that guarantees continuity.

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=123858&r1=123857&r2=123858&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Wed Jan 19 17:14:56 2011
@@ -757,7 +757,7 @@
       }
       if (!BI.LiveThrough) {
         DEBUG(dbgs() << ", killed in block.\n");
-        SE.useIntv(Start, BI.Kill);
+        SE.useIntv(Start, BI.Kill.getBoundaryIndex());
         SE.leaveIntvAfter(BI.Kill);
         continue;
       }
@@ -765,7 +765,7 @@
         // Block is live-through, but exit bundle is on the stack.
         // Spill immediately after the last use.
         DEBUG(dbgs() << ", uses, stack-out.\n");
-        SE.useIntv(Start, BI.LastUse);
+        SE.useIntv(Start, BI.LastUse.getBoundaryIndex());
         SE.leaveIntvAfter(BI.LastUse);
         continue;
       }
@@ -789,6 +789,7 @@
       SlotIndex Use = std::lower_bound(SA->UseSlots.begin(), SA->UseSlots.end(),
                                        IP.second)[-1];
       DEBUG(dbgs() << ", free use at " << Use << ".\n");
+      Use = Use.getBoundaryIndex();
       assert(Use >= BI.FirstUse && Use < IP.first);
       SE.useIntv(Start, Use);
       SE.leaveIntvAfter(Use);





More information about the llvm-commits mailing list