This is an archive of the discontinued LLVM Phabricator instance.

[Analysis] Introduce isSoleCallToLocalFunction (NFC)
ClosedPublic

Authored by kazu on Sep 17 2022, 2:09 PM.

Details

Summary

We check to see if a given CallBase is a sole call to a local function
at multiple places in InlineCost.cpp. This patch factors out the
common code.

Diff Detail

Event Timeline

kazu created this revision.Sep 17 2022, 2:09 PM
kazu requested review of this revision.Sep 17 2022, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2022, 2:09 PM
taolq accepted this revision.Sep 17 2022, 7:15 PM

LGTM

This revision is now accepted and ready to land.Sep 17 2022, 7:15 PM
This revision was landed with ongoing or failed builds.Sep 17 2022, 9:00 PM
This revision was automatically updated to reflect the committed changes.
mtrofin added inline comments.Sep 18 2022, 7:15 AM
llvm/lib/Analysis/InlineCost.cpp
1068

Isn't the Callee obtainable from CB?

kazu added inline comments.Sep 18 2022, 9:28 AM
llvm/lib/Analysis/InlineCost.cpp
1068

Yes, Callee is obtainable from CB on direct calls. On indirect calls, the callers of this function may specify Callee that is not obtainable CB.