diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-03 17:04:16 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-03 17:04:16 +0000 |
commit | 207c868c9210663d401b7f5ce5cae7c3e0943849 (patch) | |
tree | c28a834cf8edc92146e998f8e867cf3244db7e6c /lib/CodeGen/RegAllocGreedy.cpp | |
parent | 9590c7fbca2a3c18d0000676b2a6336f6458ed42 (diff) | |
download | external_llvm-207c868c9210663d401b7f5ce5cae7c3e0943849.tar.gz external_llvm-207c868c9210663d401b7f5ce5cae7c3e0943849.tar.bz2 external_llvm-207c868c9210663d401b7f5ce5cae7c3e0943849.zip |
Return live range end points from SplitEditor::enter*/leave*.
These end points come from the inserted copies, and can be passed directly to
useIntv. This simplifies the coloring code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocGreedy.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp index d970c7d16a..730bddb8b0 100644 --- a/lib/CodeGen/RegAllocGreedy.cpp +++ b/lib/CodeGen/RegAllocGreedy.cpp @@ -680,16 +680,14 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, } if (!BI.LiveThrough) { DEBUG(dbgs() << ", not live-through.\n"); - SE.enterIntvBefore(BI.Def); - SE.useIntv(BI.Def, Stop); + SE.useIntv(SE.enterIntvBefore(BI.Def), Stop); continue; } if (!RegIn) { // Block is live-through, but entry bundle is on the stack. // Reload just before the first use. DEBUG(dbgs() << ", not live-in, enter before first use.\n"); - SE.enterIntvBefore(BI.FirstUse); - SE.useIntv(BI.FirstUse, Stop); + SE.useIntv(SE.enterIntvBefore(BI.FirstUse), Stop); continue; } DEBUG(dbgs() << ", live-through.\n"); @@ -713,8 +711,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, SlotIndex Use = *UI; DEBUG(dbgs() << ", free use at " << Use << ".\n"); assert(Use <= BI.LastUse && "Couldn't find last use"); - SE.enterIntvBefore(Use); - SE.useIntv(Use, Stop); + SE.useIntv(SE.enterIntvBefore(Use), Stop); continue; } @@ -759,16 +756,14 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, } if (!BI.LiveThrough) { DEBUG(dbgs() << ", killed in block.\n"); - SE.useIntv(Start, BI.Kill.getBoundaryIndex()); - SE.leaveIntvAfter(BI.Kill); + SE.useIntv(Start, SE.leaveIntvAfter(BI.Kill)); continue; } if (!RegOut) { // 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.getBoundaryIndex()); - SE.leaveIntvAfter(BI.LastUse); + SE.useIntv(Start, SE.leaveIntvAfter(BI.LastUse)); continue; } // Register is live-through. @@ -794,8 +789,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, SlotIndex Use = (--UI)->getBoundaryIndex(); DEBUG(dbgs() << ", free use at " << *UI << ".\n"); assert(Use >= BI.FirstUse && Use < IP.first); - SE.useIntv(Start, Use); - SE.leaveIntvAfter(Use); + SE.useIntv(Start, SE.leaveIntvAfter(Use)); continue; } @@ -875,6 +869,8 @@ unsigned RAGreedy::trySplit(LiveInterval &VirtReg, AllocationOrder &Order, SmallVector<LiveInterval*, 4> SpillRegs; LiveRangeEdit LREdit(VirtReg, NewVRegs, SpillRegs); SplitEditor(*SA, *LIS, *VRM, *DomTree, LREdit).splitSingleBlocks(Blocks); + if (VerifyEnabled) + MF->verify(this, "After splitting live range around basic blocks"); } // Don't assign any physregs. |