Skip to content

[NFC][Attributor] Track the number of promoted indirect calls #106214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static cl::opt<int> MaxPotentialValuesIterations(
cl::init(64));

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

// Some helper macros to deal with statistics tracking.
//
Expand Down Expand Up @@ -12350,6 +12351,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
auto *NewCallee = AssumedCallees.front();
if (isLegalToPromote(*CB, NewCallee)) {
promoteCall(*CB, NewCallee, nullptr);
NumIndirectCallsPromoted++;
return ChangeStatus::CHANGED;
}
Instruction *NewCall =
Expand Down Expand Up @@ -12406,6 +12408,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
auto *CBClone = cast<CallBase>(CB->clone());
CBClone->insertBefore(ThenTI);
NewCall = &cast<CallInst>(promoteCall(*CBClone, NewCallee, &RetBC));
NumIndirectCallsPromoted++;
} else {
NewCall = CallInst::Create(FunctionCallee(CSFT, NewCallee), CSArgs,
CB->getName(), ThenTI->getIterator());
Expand Down
Loading