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
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index d970c7d..730bddb 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -680,16 +680,14 @@
}
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 @@
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 @@
}
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 @@
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 @@
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.