diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-05 23:50:31 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-05 23:50:31 +0000 |
| commit | 02cf10bdfdd0816031034f9ac61d2424a0d3da5b (patch) | |
| tree | 22c626249289e20c4688a5a79731096c9e2af5f1 /llvm/lib/CodeGen | |
| parent | 3fca5e27e02f130917db7b9d6d7437414d740643 (diff) | |
| download | bcm5719-llvm-02cf10bdfdd0816031034f9ac61d2424a0d3da5b.tar.gz bcm5719-llvm-02cf10bdfdd0816031034f9ac61d2424a0d3da5b.zip | |
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.
llvm-svn: 137001
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 291db7b4bfc..450f008b67a 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/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; |

