Skip to content

Commit ed2f909

Browse files
authored
[NFC][Attributor] Track the number of promoted indirect calls (#106214)
1 parent 4dda564 commit ed2f909

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static cl::opt<int> MaxPotentialValuesIterations(
107107
cl::init(64));
108108

109109
STATISTIC(NumAAs, "Number of abstract attributes created");
110+
STATISTIC(NumIndirectCallsPromoted, "Number of indirect calls promoted");
110111

111112
// Some helper macros to deal with statistics tracking.
112113
//
@@ -12350,6 +12351,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
1235012351
auto *NewCallee = AssumedCallees.front();
1235112352
if (isLegalToPromote(*CB, NewCallee)) {
1235212353
promoteCall(*CB, NewCallee, nullptr);
12354+
NumIndirectCallsPromoted++;
1235312355
return ChangeStatus::CHANGED;
1235412356
}
1235512357
Instruction *NewCall =
@@ -12406,6 +12408,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
1240612408
auto *CBClone = cast<CallBase>(CB->clone());
1240712409
CBClone->insertBefore(ThenTI);
1240812410
NewCall = &cast<CallInst>(promoteCall(*CBClone, NewCallee, &RetBC));
12411+
NumIndirectCallsPromoted++;
1240912412
} else {
1241012413
NewCall = CallInst::Create(FunctionCallee(CSFT, NewCallee), CSArgs,
1241112414
CB->getName(), ThenTI->getIterator());

0 commit comments

Comments
 (0)