Break the spill placement algorithm into three parts: prepare, addConstraints, and finish.
This will allow us to abort the algorithm early if it is determined to be futile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129020 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 4339a81..4e8891f 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -770,7 +770,10 @@
continue;
}
- SpillPlacer->placeSpills(SplitConstraints, LiveBundles);
+ SpillPlacer->prepare(LiveBundles);
+ SpillPlacer->addConstraints(SplitConstraints);
+ SpillPlacer->finish();
+
// No live bundles, defer to splitSingleBlocks().
if (!LiveBundles.any()) {
DEBUG(dbgs() << " no bundles.\n");