Use precomputed BB size instead of BB->size().
authorNick Lewycky <nicholas@mxc.ca>
Wed, 25 Jan 2012 18:54:13 +0000 (18:54 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 25 Jan 2012 18:54:13 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InlineCost.cpp

index 94b14be5e2da1fd23bc3a1d9a2d9f625363f4c9c..b326ba76893ecc5bcae3b782f03f0db6b0f44a93 100644 (file)
@@ -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());