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

Devang Patel dpatel at apple.com
Fri Mar 12 17:05:03 PST 2010


Author: dpatel
Date: Fri Mar 12 19:05:02 2010
New Revision: 98408

URL: http://llvm.org/viewvc/llvm-project?rev=98408&view=rev
Log:
Do not  ignore arg_size() impact while counting bb instructions.

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=98408&r1=98407&r2=98408&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Fri Mar 12 19:05:02 2010
@@ -142,7 +142,7 @@
 /// from the specified block.
 void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
   ++NumBlocks;
-  unsigned NumInstsInThisBB = 0;
+  unsigned NumInstsBeforeThisBB = NumInsts;
   for (BasicBlock::const_iterator II = BB->begin(), E = BB->end();
        II != E; ++II) {
     if (isa<PHINode>(II)) continue;           // PHI nodes don't count.
@@ -196,7 +196,6 @@
     }
 
     ++NumInsts;
-    ++NumInstsInThisBB;
   }
   
   if (isa<ReturnInst>(BB->getTerminator()))
@@ -211,7 +210,7 @@
     NeverInline = true;
 
   // Remember NumInsts for this BB.
-  NumBBInsts[BB] = NumInstsInThisBB;
+  NumBBInsts[BB] = NumInsts - NumInstsBeforeThisBB;
 }
 
 /// analyzeFunction - Fill in the current structure with information gleaned





More information about the llvm-commits mailing list