[llvm] 58b95c9 - [StackSafety,NFC] Add debug counters
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 6 19:24:25 PDT 2020
Author: Vitaly Buka
Date: 2020-08-06T19:24:02-07:00
New Revision: 58b95c9b2bb7d3a1422f79e6d53f5e0c5a4a0387
URL: https://github.com/llvm/llvm-project/commit/58b95c9b2bb7d3a1422f79e6d53f5e0c5a4a0387
DIFF: https://github.com/llvm/llvm-project/commit/58b95c9b2bb7d3a1422f79e6d53f5e0c5a4a0387.diff
LOG: [StackSafety,NFC] Add debug counters
Added:
Modified:
llvm/lib/Analysis/StackSafetyAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index 7043a403a427..56039d72b0c5 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -37,6 +37,15 @@ using namespace llvm;
STATISTIC(NumAllocaStackSafe, "Number of safe allocas");
STATISTIC(NumAllocaTotal, "Number of total allocas");
+STATISTIC(NumCombinedCalleeLookupTotal,
+ "Number of total callee lookups on combined index.");
+STATISTIC(NumCombinedCalleeLookupFailed,
+ "Number of failed callee lookups on combined index.");
+STATISTIC(NumModuleCalleeLookupTotal,
+ "Number of total callee lookups on module index.");
+STATISTIC(NumModuleCalleeLookupFailed,
+ "Number of failed callee lookups on module index.");
+
static cl::opt<int> StackSafetyMaxIterations("stack-safety-max-iterations",
cl::init(20), cl::Hidden);
@@ -638,8 +647,11 @@ void resolveAllCalls(UseInfo<GlobalValue> &Use,
GlobalValueSummary *GVS = getGlobalValueSummary(Index, C.Callee->getGUID());
FunctionSummary *FS = resolveCallee(GVS);
- if (!FS)
+ ++NumModuleCalleeLookupTotal;
+ if (!FS) {
+ ++NumModuleCalleeLookupFailed;
return Use.updateRange(FullSet);
+ }
const ConstantRange *Found = findParamAccess(*FS, C.ParamNo);
if (!Found)
return Use.updateRange(FullSet);
@@ -945,7 +957,9 @@ void llvm::generateParamAccessSummary(ModuleSummaryIndex &Index) {
assert(!Call.Offsets.isFullSet());
FunctionSummary *S = resolveCallee(
Index.findSummaryInModule(Call.Callee, FS->modulePath()));
+ ++NumCombinedCalleeLookupTotal;
if (!S) {
+ ++NumCombinedCalleeLookupFailed;
US.Range = FullSet;
US.Calls.clear();
break;
More information about the llvm-commits
mailing list