diff options
author | Devang Patel <dpatel@apple.com> | 2010-03-13 01:05:02 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-03-13 01:05:02 +0000 |
commit | afc33fa6d5f16089e7747ad761ae2d498ce43e90 (patch) | |
tree | 762b968185dedacfe1a68e8c21f45f210ec4d57c /lib/Analysis | |
parent | d5e7705a05947e60806b795880f09757e835f590 (diff) | |
download | external_llvm-afc33fa6d5f16089e7747ad761ae2d498ce43e90.zip external_llvm-afc33fa6d5f16089e7747ad761ae2d498ce43e90.tar.gz external_llvm-afc33fa6d5f16089e7747ad761ae2d498ce43e90.tar.bz2 |
Do not ignore arg_size() impact while counting bb instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index f14dc5d..cf2ce0e 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -142,7 +142,7 @@ static bool callIsSmall(const Function *F) { /// 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 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) { } ++NumInsts; - ++NumInstsInThisBB; } if (isa<ReturnInst>(BB->getTerminator())) @@ -211,7 +210,7 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) { NeverInline = true; // Remember NumInsts for this BB. - NumBBInsts[BB] = NumInstsInThisBB; + NumBBInsts[BB] = NumInsts - NumInstsBeforeThisBB; } /// analyzeFunction - Fill in the current structure with information gleaned |