summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-23 03:22:33 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-23 03:22:33 +0000
commita953bf135f6469560042d056e3dbf8da7005282f (patch)
treefb9e345f569def752803b99fa2c7e8771493d66d /llvm/lib/CodeGen
parent0ab5d0ee5b13514a939d9131e9a6227eb6014bae (diff)
downloadbcm5719-llvm-a953bf135f6469560042d056e3dbf8da7005282f.tar.gz
bcm5719-llvm-a953bf135f6469560042d056e3dbf8da7005282f.zip
Prepare RAGreedy::growRegion for compact regions.
A split candidate can have a null PhysReg which means that it doesn't map to a real interference pattern. Instead, pretend that all through blocks have interference. This makes it possible to generate compact regions where the live range doesn't go through blocks that don't use it. The live range will still be live between directly connected blocks with uses. Splitting around a compact region tends to produce a live range with a high spill weight, so it may evict a less dense live range. llvm-svn: 135845
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocGreedy.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 570a832303a..0267717b843 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -749,7 +749,14 @@ void RAGreedy::growRegion(GlobalSplitCandidate &Cand) {
// Any new blocks to add?
if (ActiveBlocks.size() == AddedTo)
break;
- addThroughConstraints(Cand.Intf, makeArrayRef(ActiveBlocks).slice(AddedTo));
+
+ // Compute through constraints from the interference, or assume that all
+ // through blocks prefer spilling when forming compact regions.
+ ArrayRef<unsigned> NewBlocks = makeArrayRef(ActiveBlocks).slice(AddedTo);
+ if (Cand.PhysReg)
+ addThroughConstraints(Cand.Intf, NewBlocks);
+ else
+ SpillPlacer->addPrefSpill(NewBlocks);
AddedTo = ActiveBlocks.size();
// Perhaps iterating can enable more bundles?
OpenPOWER on IntegriCloud