aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SpillPlacement.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-03 23:09:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-03 23:09:38 +0000
commitb87f91b063a0ac853735f2af3bd94fb8551a11ff (patch)
tree68162dfb4436276c66c8ed6aa4b79c6f096ef67b /lib/CodeGen/SpillPlacement.cpp
parent32668ea7a290ee1cb6bfe8cd677cdd4e5df05b4d (diff)
Be more conservative when forming compact regions.
Apply twice the negative bias on transparent blocks when computing the compact regions. This excludes loop backedges from the region when only one of the loop blocks uses the register. Previously, we would include the backedge in the region if the loop preheader and the loop latch both used the register, but the loop header didn't. When both the header and latch blocks use the register, we still keep it live on the backedge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--lib/CodeGen/SpillPlacement.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SpillPlacement.cpp b/lib/CodeGen/SpillPlacement.cpp
index 10a3c18962..6f33f5465c 100644
--- a/lib/CodeGen/SpillPlacement.cpp
+++ b/lib/CodeGen/SpillPlacement.cpp
@@ -241,10 +241,12 @@ void SpillPlacement::addConstraints(ArrayRef<BlockConstraint> LiveBlocks) {
}
/// addPrefSpill - Same as addConstraints(PrefSpill)
-void SpillPlacement::addPrefSpill(ArrayRef<unsigned> Blocks) {
+void SpillPlacement::addPrefSpill(ArrayRef<unsigned> Blocks, bool Strong) {
for (ArrayRef<unsigned>::iterator I = Blocks.begin(), E = Blocks.end();
I != E; ++I) {
float Freq = getBlockFrequency(*I);
+ if (Strong)
+ Freq += Freq;
unsigned ib = bundles->getBundle(*I, 0);
unsigned ob = bundles->getBundle(*I, 1);
activate(ib);