aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-06 22:17:33 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-06 22:17:33 +0000
commit729effdfba20fb5c1d08fe738d59c9decd9506ed (patch)
treec0e36f48b6e73127b81d74482435b2a3149b0c02 /lib/CodeGen/InlineSpiller.cpp
parente7c8c4540bd420df2ba79f81ede200d059c750d5 (diff)
downloadexternal_llvm-729effdfba20fb5c1d08fe738d59c9decd9506ed.zip
external_llvm-729effdfba20fb5c1d08fe738d59c9decd9506ed.tar.gz
external_llvm-729effdfba20fb5c1d08fe738d59c9decd9506ed.tar.bz2
Lazily defer duplicating the live interval we are splitting until we know it is
necessary. Sometimes, live range splitting doesn't shrink the current interval, but simply changes some instructions to use a new interval. That makes the original more suitable for spilling. In this case, we don't need to duplicate the original. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--lib/CodeGen/InlineSpiller.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp
index 1492566..5ac6610 100644
--- a/lib/CodeGen/InlineSpiller.cpp
+++ b/lib/CodeGen/InlineSpiller.cpp
@@ -113,9 +113,10 @@ bool InlineSpiller::split() {
splitAnalysis_.analyze(li_);
if (const MachineLoop *loop = splitAnalysis_.getBestSplitLoop()) {
- SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
- .splitAroundLoop(loop);
- return true;
+ // We can split, but li_ may be left intact with fewer uses.
+ if (SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_)
+ .splitAroundLoop(loop))
+ return true;
}
return false;
}