aboutsummaryrefslogtreecommitdiffstats
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
commit4aca44260dcea424a6c4aadf08b776b0c45fc99b (patch)
treeaf11c71252b8c0e10c3d5516f021688fbc26d23b /lib/CodeGen/InlineSpiller.cpp
parent1e393466e1595ccfe44de466a8db570a44db8c8b (diff)
downloadexternal_llvm-4aca44260dcea424a6c4aadf08b776b0c45fc99b.zip
external_llvm-4aca44260dcea424a6c4aadf08b776b0c45fc99b.tar.gz
external_llvm-4aca44260dcea424a6c4aadf08b776b0c45fc99b.tar.bz2
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 7978372..18dbe9c 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;
}