summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd2a7d1ed97f79a1de8ee2f9c2ca11e29d352e23a (patch)
tree57102a505439e5c557a2f64edb2485270abcc1f3 /llvm/lib/CodeGen/SpillPlacement.cpp
parentbbcb7cde345a5e73e02463aa74de9ab2f2a9c7df (diff)
downloadbcm5719-llvm-d2a7d1ed97f79a1de8ee2f9c2ca11e29d352e23a.tar.gz
bcm5719-llvm-d2a7d1ed97f79a1de8ee2f9c2ca11e29d352e23a.zip
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. llvm-svn: 136731
Diffstat (limited to 'llvm/lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/SpillPlacement.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SpillPlacement.cpp b/llvm/lib/CodeGen/SpillPlacement.cpp
index ce7b37bfce5..10a3c189624 100644
--- a/llvm/lib/CodeGen/SpillPlacement.cpp
+++ b/llvm/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
};
OpenPOWER on IntegriCloud