llvm.org GIT mirror llvm / d6fc262
Add two statistics to help track how we are computing the inline cost. Yea, 'NumCallerCallersAnalyzed' isn't a great name, suggestions welcome. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154492 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 8 years ago
2 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2828 #include "llvm/ADT/SetVector.h"
2929 #include "llvm/ADT/SmallVector.h"
3030 #include "llvm/ADT/SmallPtrSet.h"
31 #include "llvm/ADT/Statistic.h"
3132
3233 using namespace llvm;
34
35 STATISTIC(NumCallsAnalyzed, "Number of call sites analyzed");
3336
3437 namespace {
3538
801804 /// is below the computed threshold, then inlining was forcibly disabled by
802805 /// some artifact of the rountine.
803806 bool CallAnalyzer::analyzeCall(CallSite CS) {
807 ++NumCallsAnalyzed;
808
804809 // Track whether the post-inlining function would have more than one basic
805810 // block. A single basic block is often intended for inlining. Balloon the
806811 // threshold by 50% until we pass the single-BB phase.
3434 STATISTIC(NumCallsDeleted, "Number of call sites deleted, not inlined");
3535 STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
3636 STATISTIC(NumMergedAllocas, "Number of allocas merged together");
37
38 // This weirdly named statistic tracks the number of times that, when attemting
39 // to inline a function A into B, we analyze the callers of B in order to see
40 // if those would be more profitable and blocked inline steps.
41 STATISTIC(NumCallerCallersAnalyzed, "Number of caller-callers analyzed");
3742
3843 static cl::opt
3944 InlineLimit("inline-threshold", cl::Hidden, cl::init(225), cl::ZeroOrMore,
276281 }
277282
278283 InlineCost IC2 = getInlineCost(CS2);
284 ++NumCallerCallersAnalyzed;
279285 if (!IC2) {
280286 callerWillBeRemoved = false;
281287 continue;