aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-13 21:18:48 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-13 21:18:48 +0000
commitfc412d85c46a8656361fe1e9197ea85922e2cd61 (patch)
treeaf11c71252b8c0e10c3d5516f021688fbc26d23b /lib/CodeGen/InlineSpiller.cpp
parente62d58884ad83d0351b9511d58eed4b21ff6e0b1 (diff)
Implement splitting inside a single block.
When a live range is contained a single block, we can split it around instruction clusters. The current approach is very primitive, splitting before and after the largest gap between uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--lib/CodeGen/InlineSpiller.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp
index 7978372e48..18dbe9cb2c 100644
--- a/lib/CodeGen/InlineSpiller.cpp
+++ b/lib/CodeGen/InlineSpiller.cpp
@@ -106,10 +106,6 @@ Spiller *createInlineSpiller(MachineFunctionPass &pass,
/// split - try splitting the current interval into pieces that may allocate
/// separately. Return true if successful.
bool InlineSpiller::split() {
- // FIXME: Add intra-MBB splitting.
- if (lis_.intervalIsInOneMBB(*li_))
- return false;
-
splitAnalysis_.analyze(li_);
if (const MachineLoop *loop = splitAnalysis_.getBestSplitLoop()) {
@@ -127,6 +123,15 @@ bool InlineSpiller::split() {
return true;
}
+ // Try splitting inside a basic block.
+ if (const MachineBasicBlock *MBB = splitAnalysis_.getBlockForInsideSplit()) {
+ if (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;
}