diff options
author | Jakub Staszak <jstaszak@apple.com> | 2011-06-23 23:52:11 +0000 |
---|---|---|
committer | Jakub Staszak <jstaszak@apple.com> | 2011-06-23 23:52:11 +0000 |
commit | 66dddd1da3e036d05f94df82221a97b7d26e3498 (patch) | |
tree | dab8e540bcd86316d6e64b1fa8e04d2bcd15fc86 /lib/Analysis | |
parent | 0edb05b9e4a63d469a6cc9e15fa0dc8de7ee1cdf (diff) |
Calculate backedge probability correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/BranchProbabilityInfo.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/Analysis/BranchProbabilityInfo.cpp b/lib/Analysis/BranchProbabilityInfo.cpp index 263ea2c26b..15059c733a 100644 --- a/lib/Analysis/BranchProbabilityInfo.cpp +++ b/lib/Analysis/BranchProbabilityInfo.cpp @@ -279,21 +279,6 @@ uint32_t BranchProbabilityInfo::getSumForBlock(BasicBlock *BB) const { return Sum; } -uint32_t BranchProbabilityInfo::getBackSumForBlock(BasicBlock *BB) const { - uint32_t Sum = 0; - - for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) { - BasicBlock *Pred = *I; - uint32_t Weight = getEdgeWeight(Pred, BB); - uint32_t PrevSum = Sum; - - Sum += Weight; - assert(Sum > PrevSum); (void) PrevSum; - } - - return Sum; -} - bool BranchProbabilityInfo::isEdgeHot(BasicBlock *Src, BasicBlock *Dst) const { // Hot probability is at least 4/5 = 80% uint32_t Weight = getEdgeWeight(Src, Dst); @@ -360,15 +345,6 @@ getEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const { return BranchProbability(N, D); } -BranchProbability BranchProbabilityInfo:: -getBackEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const { - - uint32_t N = getEdgeWeight(Src, Dst); - uint32_t D = getBackSumForBlock(Dst); - - return BranchProbability(N, D); -} - raw_ostream & BranchProbabilityInfo::printEdgeProbability(raw_ostream &OS, BasicBlock *Src, BasicBlock *Dst) const { |