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 | 93142469ac7cbeee2a0e64016bd5e473b674218b (patch) | |
| tree | 3ceb6b355fdeafebf91bb73a029440364dad9d9a | |
| parent | 18fc344290d7241fd47a9eaba21cde777e7bae9e (diff) | |
| download | bcm5719-llvm-93142469ac7cbeee2a0e64016bd5e473b674218b.tar.gz bcm5719-llvm-93142469ac7cbeee2a0e64016bd5e473b674218b.zip | |
Do not ignore arg_size() impact while counting bb instructions.
llvm-svn: 98408
| -rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index f14dc5d3478..cf2ce0e06a7 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/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 |

