aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-05 23:50:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-05 23:50:31 +0000
commita9c41d39d1adc92107e095aca6f851aed71b6a5f (patch)
tree6d509a95a8057901280d067ba8cf03a47056405a /lib/CodeGen/RegAllocGreedy.cpp
parent1f8804263ffc5e6843d81f5c7bd9c739aa90fde5 (diff)
downloadexternal_llvm-a9c41d39d1adc92107e095aca6f851aed71b6a5f.zip
external_llvm-a9c41d39d1adc92107e095aca6f851aed71b6a5f.tar.gz
external_llvm-a9c41d39d1adc92107e095aca6f851aed71b6a5f.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 291db7b..450f008 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -1227,12 +1227,22 @@ unsigned RAGreedy::tryBlockSplit(LiveInterval &VirtReg, AllocationOrder &Order,
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;