Update SplitEditor API to reflect the fact that the original live interval is

never kept after splitting.

Keeping the original interval made sense when the split region doesn't modify
the register, and the original is spilled. We can get the same effect by
detecting reloaded values when spilling around copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2010-10-05 22:19:33 +00:00
parent dbc36091ff
commit 57d0f2deb0
3 changed files with 26 additions and 38 deletions

View File

@ -107,30 +107,28 @@ Spiller *createInlineSpiller(MachineFunctionPass &pass,
bool InlineSpiller::split() {
splitAnalysis_.analyze(li_);
// Try splitting around loops.
if (const MachineLoop *loop = splitAnalysis_.getBestSplitLoop()) {
// We can split, but li_ may be left intact with fewer uses.
if (SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitAroundLoop(loop))
return true;
SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitAroundLoop(loop);
return true;
}
// Try splitting into single block intervals.
SplitAnalysis::BlockPtrSet blocks;
if (splitAnalysis_.getMultiUseBlocks(blocks)) {
if (SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitSingleBlocks(blocks))
return true;
SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitSingleBlocks(blocks);
return true;
}
// Try splitting inside a basic block.
if (const MachineBasicBlock *MBB = splitAnalysis_.getBlockForInsideSplit()) {
if (SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitInsideBlock(MBB))
return true;
SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
.splitInsideBlock(MBB);
return true;
}
// We may have been able to split out some uses, but the original interval is
// intact, and it should still be spilled.
return false;
}