[llvm-commits] [llvm] r148964 - /llvm/trunk/lib/Analysis/InlineCost.cpp

Nick Lewycky nicholas at mxc.ca
Wed Jan 25 10:54:13 PST 2012


Author: nicholas
Date: Wed Jan 25 12:54:13 2012
New Revision: 148964

URL: http://llvm.org/viewvc/llvm-project?rev=148964&view=rev
Log:
Use precomputed BB size instead of BB->size().

Modified:
    llvm/trunk/lib/Analysis/InlineCost.cpp

Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=148964&r1=148963&r2=148964&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Wed Jan 25 12:54:13 2012
@@ -331,7 +331,7 @@
         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());





More information about the llvm-commits mailing list