summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-02 23:04:08 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-02 23:04:08 +0000
commit3c14505164fd0b2111e6906ca3671b55e87b18f6 (patch)
tree1132aa53d75652d91097489d4a3d657ac04e1c11
parent057f9b68dee906a3d22aa951c5a0c5351aa15228 (diff)
downloadbcm5719-llvm-3c14505164fd0b2111e6906ca3671b55e87b18f6.tar.gz
bcm5719-llvm-3c14505164fd0b2111e6906ca3671b55e87b18f6.zip
Use the precomputed def presence in RAGreedy::calcSpillCost.
llvm-svn: 136742
-rw-r--r--llvm/lib/CodeGen/RegAllocGreedy.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 6f4eb5baab4..1afe1f71e9f 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -864,7 +864,6 @@ bool RAGreedy::calcCompactRegion(GlobalSplitCandidate &Cand) {
/// SA around all use blocks instead of forming bundle regions.
float RAGreedy::calcSpillCost() {
float Cost = 0;
- const LiveInterval &LI = SA->getParent();
ArrayRef<SplitAnalysis::BlockInfo> UseBlocks = SA->getUseBlocks();
for (unsigned i = 0; i != UseBlocks.size(); ++i) {
const SplitAnalysis::BlockInfo &BI = UseBlocks[i];
@@ -873,16 +872,8 @@ float RAGreedy::calcSpillCost() {
Cost += SpillPlacer->getBlockFrequency(Number);
// Unless the value is redefined in the block.
- if (BI.LiveIn && BI.LiveOut) {
- SlotIndex Start, Stop;
- tie(Start, Stop) = Indexes->getMBBRange(Number);
- LiveInterval::const_iterator I = LI.find(Start);
- assert(I != LI.end() && "Expected live-in value");
- // Is there a different live-out value? If so, we need an extra spill
- // instruction.
- if (I->end < Stop)
- Cost += SpillPlacer->getBlockFrequency(Number);
- }
+ if (BI.LiveIn && BI.LiveOut && BI.FirstDef)
+ Cost += SpillPlacer->getBlockFrequency(Number);
}
return Cost;
}
OpenPOWER on IntegriCloud