mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Create new intervals for isolated blocks during region splitting.
This merges the behavior of splitSingleBlocks into splitAroundRegion, so the RS_Region and RS_Block register stages can be coalesced. That means the leftover intervals after region splitting go directly to spilling instead of a second pass of per-block splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -935,6 +935,22 @@ bool SplitAnalysis::getMultiUseBlocks(BlockPtrSet &Blocks) {
|
||||
return !Blocks.empty();
|
||||
}
|
||||
|
||||
void SplitEditor::splitSingleBlock(const SplitAnalysis::BlockInfo &BI) {
|
||||
openIntv();
|
||||
SlotIndex LastSplitPoint = SA.getLastSplitPoint(BI.MBB->getNumber());
|
||||
SlotIndex SegStart = enterIntvBefore(std::min(BI.FirstUse,
|
||||
LastSplitPoint));
|
||||
if (!BI.LiveOut || BI.LastUse < LastSplitPoint) {
|
||||
useIntv(SegStart, leaveIntvAfter(BI.LastUse));
|
||||
} else {
|
||||
// The last use is after the last valid split point.
|
||||
SlotIndex SegStop = leaveIntvBefore(LastSplitPoint);
|
||||
useIntv(SegStart, SegStop);
|
||||
overlapIntv(SegStop, BI.LastUse);
|
||||
}
|
||||
closeIntv();
|
||||
}
|
||||
|
||||
/// splitSingleBlocks - Split CurLI into a separate live interval inside each
|
||||
/// basic block in Blocks.
|
||||
void SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
||||
@@ -942,22 +958,8 @@ void SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
||||
ArrayRef<SplitAnalysis::BlockInfo> UseBlocks = SA.getUseBlocks();
|
||||
for (unsigned i = 0; i != UseBlocks.size(); ++i) {
|
||||
const SplitAnalysis::BlockInfo &BI = UseBlocks[i];
|
||||
if (!Blocks.count(BI.MBB))
|
||||
continue;
|
||||
|
||||
openIntv();
|
||||
SlotIndex LastSplitPoint = SA.getLastSplitPoint(BI.MBB->getNumber());
|
||||
SlotIndex SegStart = enterIntvBefore(std::min(BI.FirstUse,
|
||||
LastSplitPoint));
|
||||
if (!BI.LiveOut || BI.LastUse < LastSplitPoint) {
|
||||
useIntv(SegStart, leaveIntvAfter(BI.LastUse));
|
||||
} else {
|
||||
// The last use is after the last valid split point.
|
||||
SlotIndex SegStop = leaveIntvBefore(LastSplitPoint);
|
||||
useIntv(SegStart, SegStop);
|
||||
overlapIntv(SegStop, BI.LastUse);
|
||||
}
|
||||
closeIntv();
|
||||
if (Blocks.count(BI.MBB))
|
||||
splitSingleBlock(BI);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
Reference in New Issue
Block a user