summaryrefslogtreecommitdiff
path: root/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-01-25 18:54:13 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-01-25 18:54:13 +0000
commit0c8515f0969e0a4d0b5313c6ceadd5ff4dab5998 (patch)
treedf0a064749770cf16dd88c5ac30eb9d2bb270b01 /lib/Analysis/InlineCost.cpp
parent97484795904498acc5f88df23498c65fcf151a7f (diff)
downloadllvm-0c8515f0969e0a4d0b5313c6ceadd5ff4dab5998.tar.gz
llvm-0c8515f0969e0a4d0b5313c6ceadd5ff4dab5998.tar.bz2
llvm-0c8515f0969e0a4d0b5313c6ceadd5ff4dab5998.tar.xz
Use precomputed BB size instead of BB->size().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InlineCost.cpp')
-rw-r--r--lib/Analysis/InlineCost.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp
index 94b14be5e2..b326ba7689 100644
--- a/lib/Analysis/InlineCost.cpp
+++ b/lib/Analysis/InlineCost.cpp
@@ -331,7 +331,7 @@ unsigned CodeMetrics::CountCodeReductionForAlloca(Value *V) {
if (BranchInst *BI = dyn_cast<BranchInst>(I)) {
BasicBlock *BB = BI->getSuccessor(Result ? 0 : 1);
if (BB->getSinglePredecessor())
- Reduction += InlineConstants::InstrCost * BB->size();
+ Reduction += InlineConstants::InstrCost * NumBBInsts[BB];
}
}
} while (!Worklist.empty());