Captures state between an inlining decision and observing its impact.

Synopsis

Declared in <llvm/Analysis/InlineAdvisor.h>

class InlineAdvice;

Description

Capture state between an inlining decision having had been made, and its impact being observable. When collecting model training data, this allows recording features/decisions/partial reward data sets.

Derivations of this type are expected to be tightly coupled with their InliningAdvisors. The base type implements the minimal contractual obligations.

Member Functions

Name

Description

InlineAdvice [constructor]

Constructors

~InlineAdvice [destructor] [virtual]

Destroy advice after the inliner has recorded its decision.

getOriginalCallSiteBasicBlock

Return the original call site basic block.

getOriginalCallSiteDebugLoc

Return the original call site debug location.

isInliningRecommended

Get the inlining recommendation.

recordInlining

Exactly one of the record* APIs must be called. Implementers may extend behavior by implementing the corresponding record*Impl.

recordInliningWithCalleeDeleted

Call after inlining succeeded, and results in the callee being delete‐able, meaning, it has no more users, and will be cleaned up subsequently.

recordUnattemptedInlining

Call to indicate inlining was not attempted.

recordUnsuccessfulInlining

Call after the decision for a call site was to not inline.

Protected Member Functions

Name

Description

recordInliningImpl [virtual]

Hook invoked when successful inlining did not delete the callee.

recordInliningWithCalleeDeletedImpl [virtual]

Hook invoked when successful inlining left the callee delete‐able.

recordUnattemptedInliningImpl [virtual]

Hook invoked when inlining was not attempted.

recordUnsuccessfulInliningImpl [virtual]

Hook invoked when inlining was decided against.

Protected Data Members

Name

Description

Advisor

Owning advisor that produced this advice.

Block

Basic block containing the original call site.

Callee

Callee function before inlining.

Caller

Caller function before inlining.

DLoc

Debug location of the original call site.

IsInliningRecommended

Whether this advice recommends inlining.

ORE

Remark emitter for reporting inlining outcomes.

Derived Classes

Name

Description

DefaultInlineAdvice

Default InlineAdvice that records outcomes using an optional InlineCost.

MLInlineAdvice

InlineAdvice that tracks changes post inlining. For that reason, it only overrides the "successful inlining" extension points.

Created with MrDocs