diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-02 23:04:08 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-02 23:04:08 +0000 |
commit | 3f5beede1bb97ba4e06dc300e00b70e1013e7216 (patch) | |
tree | 7fb0f76d2aa52c07257b213dad069de594c1f794 /lib | |
parent | 5ebca793db6262386d7464d03cdaefeb5b640ad3 (diff) | |
download | external_llvm-3f5beede1bb97ba4e06dc300e00b70e1013e7216.zip external_llvm-3f5beede1bb97ba4e06dc300e00b70e1013e7216.tar.gz external_llvm-3f5beede1bb97ba4e06dc300e00b70e1013e7216.tar.bz2 |
Use the precomputed def presence in RAGreedy::calcSpillCost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/RegAllocGreedy.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp index 6f4eb5b..1afe1f7 100644 --- a/lib/CodeGen/RegAllocGreedy.cpp +++ b/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; } |