llvm::InlineAdvisor

Interface for deciding whether to inline a call site or not.

Synopsis

Declared in <llvm/Analysis/InlineAdvisor.h>

class InlineAdvisor;

Member Functions

NameDescription
InlineAdvisor [constructor] [deleted]Deleted; InlineAdvisor is not movable.
~InlineAdvisor [destructor] [virtual]Destroy the advisor and any owned statistics.
getAdvice Get an InlineAdvice recommending whether to inline call site CB.
getAnnotatedInlinePassName NOTE pass name is annotated only when inline advisor constructor provides InlineContext.
onPassEntry [virtual]Update advisor state when the Inliner pass is entered.
onPassExit [virtual]Prepare advisor state when the Inliner pass is exited.
print [virtual]Print advisor state to OS.

Protected Enums

NameDescription
MandatoryInliningKind Kind of mandatory inlining constraint on a call site.

Protected Member Functions

NameDescription
InlineAdvisor [constructor]Construct an advisor for module M using analyses from FAM.
getAdviceImpl [virtual]Compute advice for call site CB.
getCallerORE Return the OptimizationRemarkEmitter for the caller of CB.
getMandatoryAdvice [virtual]Compute mandatory (always/never) advice for call site CB.

Protected Static Member Functions

NameDescription
getMandatoryKind Classify the mandatory inlining kind of call site CB.

Protected Data Members

NameDescription
AnnotatedInlinePassName Annotated inline pass name for remarks, when IC was provided.
FAM Function analysis manager providing analyses for advice.
IC Optional pipeline context used when constructing this advisor.
ImportedFunctionsStats Statistics for functions imported and then inlined.
M Module whose call sites are advised.

Friends

NameDescription
llvm::InlineAdviceCaptures state between an inlining decision and observing its impact.

Non-Member Functions

NameDescription
getDevelopmentModeAdvisorCreate a development-mode (dynamic model) InlineAdvisor for M.
getReleaseModeAdvisorCreate a release-mode (compiled-in model) InlineAdvisor for M.
getReplayInlineAdvisorCreate a replay inline advisor that consults prior inlining remarks.

Derived Classes

NameDescription
DefaultInlineAdvisor The default (manual heuristics) implementation of the InlineAdvisor.
MLInlineAdvisor InlineAdvisor that uses an ML model runner to decide whether to inline.
ReplayInlineAdvisor Replay inline advisor that uses optimization remarks from inlining of previous build to guide current inlining. This is useful for inliner tuning.