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 | f12e120743102dbc8b87ff7e1b1b221ad96cea31 (patch) | |
tree | 78be0d9acea3848dd746dc88c8019b0cc9844a5b /llvm/lib/CodeGen/RegAllocGreedy.cpp | |
parent | 2b855eb69c01d7a3d8ae2c87f309544a4362e723 (diff) | |
download | bcm5719-llvm-f12e120743102dbc8b87ff7e1b1b221ad96cea31.tar.gz bcm5719-llvm-f12e120743102dbc8b87ff7e1b1b221ad96cea31.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.
llvm-svn: 124799
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index d970c7d16a7..730bddb8b00 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/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. |