summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SpillPlacement.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-02 21:53:03 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-02 21:53:03 +0000
commit0e0a8806d49038b60a0c20427d9f410b01cbb012 (patch)
tree9a33b338d2ead7da2d2043b367fe301fe05b275a /lib/CodeGen/SpillPlacement.cpp
parentf78faf84a85262bf76295dfc5d85e1e7a942a4f2 (diff)
downloadllvm-0e0a8806d49038b60a0c20427d9f410b01cbb012.tar.gz
llvm-0e0a8806d49038b60a0c20427d9f410b01cbb012.tar.bz2
llvm-0e0a8806d49038b60a0c20427d9f410b01cbb012.tar.xz
Extend the SpillPlacement interface with two new features.
The PrefBoth constraint is used for blocks that ideally want a live-in value both on the stack and in a register. This would be used by a block that has a use before interference forces a spill. Secondly, add the ChangesValue flag to BlockConstraint. This tells SpillPlacement if a live-in value on the stack can be reused as a live-out stack value for free. If the block redefines the virtual register, a spill would be required for that. This extra information will be used by SpillPlacement to more accurately calculate spill costs when a value can exist both on the stack and in a register. The simplest example is a basic block that reads the virtual register, but doesn't change its value. Spilling around such a block requires a reload, but no spill in the block. The spiller already knows this, but the spill placer doesn't. That can sometimes lead to suboptimal regions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--lib/CodeGen/SpillPlacement.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/SpillPlacement.cpp b/lib/CodeGen/SpillPlacement.cpp
index ce7b37bfce..10a3c18962 100644
--- a/lib/CodeGen/SpillPlacement.cpp
+++ b/lib/CodeGen/SpillPlacement.cpp
@@ -220,6 +220,7 @@ void SpillPlacement::addConstraints(ArrayRef<BlockConstraint> LiveBlocks) {
0, // DontCare,
1, // PrefReg,
-1, // PrefSpill
+ 0, // PrefBoth
-HUGE_VALF // MustSpill
};