From: Nick Lewycky Date: Wed, 25 Jan 2012 18:54:13 +0000 (+0000) Subject: Use precomputed BB size instead of BB->size(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c8515f0969e0a4d0b5313c6ceadd5ff4dab5998;p=oota-llvm.git 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 --- diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index 94b14be5e2d..b326ba76893 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(I)) { BasicBlock *BB = BI->getSuccessor(Result ? 0 : 1); if (BB->getSinglePredecessor()) - Reduction += InlineConstants::InstrCost * BB->size(); + Reduction += InlineConstants::InstrCost * NumBBInsts[BB]; } } } while (!Worklist.empty());