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

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Aug 5 16:50:31 PDT 2011


Author: stoklund
Date: Fri Aug  5 18:50:31 2011
New Revision: 137001

URL: http://llvm.org/viewvc/llvm-project?rev=137001&view=rev
Log:
Only mark remainder intervals as RS_Spill after per-block splitting.

The local ranges created get to stay in the RS_New stage, just like for
local and region splitting.

This gives tryLocalSplit a bit more freedom the first time it sees one
of these new local ranges.

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=137001&r1=137000&r2=137001&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Fri Aug  5 18:50:31 2011
@@ -1227,12 +1227,22 @@
     return 0;
 
   // We did split for some blocks.
-  SE->finish();
+  SmallVector<unsigned, 8> IntvMap;
+  SE->finish(&IntvMap);
 
   // Tell LiveDebugVariables about the new ranges.
   DebugVars->splitRegister(Reg, LREdit.regs());
 
-  setStage(NewVRegs.begin(), NewVRegs.end(), RS_Spill);
+  ExtraRegInfo.resize(MRI->getNumVirtRegs());
+
+  // Sort out the new intervals created by splitting. The remainder interval
+  // goes straight to spilling, the new local ranges get to stay RS_New.
+  for (unsigned i = 0, e = LREdit.size(); i != e; ++i) {
+    LiveInterval &LI = *LREdit.get(i);
+    if (getStage(LI) == RS_New && IntvMap[i] == 0)
+      setStage(LI, RS_Spill);
+  }
+
   if (VerifyEnabled)
     MF->verify(this, "After splitting live range around basic blocks");
   return 0;





More information about the llvm-commits mailing list