LLVM 22.0.0git
llvm::InlineAdvice Class Reference

Capture state between an inlining decision having had been made, and its impact being observable. More...

#include "llvm/Analysis/InlineAdvisor.h"

Inheritance diagram for llvm::InlineAdvice:
[legend]

Public Member Functions

LLVM_ABI InlineAdvice (InlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool IsInliningRecommended)
 InlineAdvice (InlineAdvice &&)=delete
 InlineAdvice (const InlineAdvice &)=delete
virtual ~InlineAdvice ()
LLVM_ABI void recordInlining ()
 Exactly one of the record* APIs must be called.
LLVM_ABI void 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.
void recordUnsuccessfulInlining (const InlineResult &Result)
 Call after the decision for a call site was to not inline.
void recordUnattemptedInlining ()
 Call to indicate inlining was not attempted.
bool isInliningRecommended () const
 Get the inlining recommendation.
const DebugLocgetOriginalCallSiteDebugLoc () const
const BasicBlockgetOriginalCallSiteBasicBlock () const

Protected Member Functions

virtual void recordInliningImpl ()
virtual void recordInliningWithCalleeDeletedImpl ()
virtual void recordUnsuccessfulInliningImpl (const InlineResult &Result)
virtual void recordUnattemptedInliningImpl ()

Protected Attributes

InlineAdvisor *const Advisor
Function *const Caller
 Caller and Callee are pre-inlining.
Function *const Callee
const DebugLoc DLoc
const BasicBlock *const Block
OptimizationRemarkEmitterORE
const bool IsInliningRecommended

Detailed 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.

Definition at line 75 of file InlineAdvisor.h.

Constructor & Destructor Documentation

◆ InlineAdvice() [1/3]

◆ InlineAdvice() [2/3]

llvm::InlineAdvice::InlineAdvice ( InlineAdvice && )
delete

References InlineAdvice().

◆ InlineAdvice() [3/3]

llvm::InlineAdvice::InlineAdvice ( const InlineAdvice & )
delete

References InlineAdvice().

◆ ~InlineAdvice()

virtual llvm::InlineAdvice::~InlineAdvice ( )
inlinevirtual

Definition at line 83 of file InlineAdvisor.h.

References assert().

Member Function Documentation

◆ getOriginalCallSiteBasicBlock()

const BasicBlock * llvm::InlineAdvice::getOriginalCallSiteBasicBlock ( ) const
inline

Definition at line 114 of file InlineAdvisor.h.

References Block.

◆ getOriginalCallSiteDebugLoc()

const DebugLoc & llvm::InlineAdvice::getOriginalCallSiteDebugLoc ( ) const
inline

Definition at line 113 of file InlineAdvisor.h.

References DLoc.

◆ isInliningRecommended()

bool llvm::InlineAdvice::isInliningRecommended ( ) const
inline

Get the inlining recommendation.

Definition at line 112 of file InlineAdvisor.h.

References IsInliningRecommended.

◆ recordInlining()

void InlineAdvice::recordInlining ( )

Exactly one of the record* APIs must be called.

Implementers may extend behavior by implementing the corresponding record*Impl.

Call after inlining succeeded, and did not result in deleting the callee.

Definition at line 202 of file InlineAdvisor.cpp.

References recordInliningImpl().

◆ recordInliningImpl()

virtual void llvm::InlineAdvice::recordInliningImpl ( )
inlineprotectedvirtual

Reimplemented in llvm::MLInlineAdvice.

Definition at line 117 of file InlineAdvisor.h.

Referenced by recordInlining().

◆ recordInliningWithCalleeDeleted()

void InlineAdvice::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.

Definition at line 208 of file InlineAdvisor.cpp.

References recordInliningWithCalleeDeletedImpl().

◆ recordInliningWithCalleeDeletedImpl()

virtual void llvm::InlineAdvice::recordInliningWithCalleeDeletedImpl ( )
inlineprotectedvirtual

Reimplemented in llvm::MLInlineAdvice.

Definition at line 118 of file InlineAdvisor.h.

Referenced by recordInliningWithCalleeDeleted().

◆ recordUnattemptedInlining()

void llvm::InlineAdvice::recordUnattemptedInlining ( )
inline

Call to indicate inlining was not attempted.

Definition at line 106 of file InlineAdvisor.h.

References recordUnattemptedInliningImpl().

◆ recordUnattemptedInliningImpl()

virtual void llvm::InlineAdvice::recordUnattemptedInliningImpl ( )
inlineprotectedvirtual

Reimplemented in llvm::MLInlineAdvice.

Definition at line 120 of file InlineAdvisor.h.

Referenced by recordUnattemptedInlining().

◆ recordUnsuccessfulInlining()

void llvm::InlineAdvice::recordUnsuccessfulInlining ( const InlineResult & Result)
inline

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

Definition at line 100 of file InlineAdvisor.h.

References recordUnsuccessfulInliningImpl().

◆ recordUnsuccessfulInliningImpl()

virtual void llvm::InlineAdvice::recordUnsuccessfulInliningImpl ( const InlineResult & Result)
inlineprotectedvirtual

Reimplemented in llvm::MLInlineAdvice.

Definition at line 119 of file InlineAdvisor.h.

Referenced by recordUnsuccessfulInlining().

Member Data Documentation

◆ Advisor

InlineAdvisor* const llvm::InlineAdvice::Advisor
protected

◆ Block

◆ Callee

Function* const llvm::InlineAdvice::Callee
protected

◆ Caller

Function* const llvm::InlineAdvice::Caller
protected

◆ DLoc

◆ IsInliningRecommended

const bool llvm::InlineAdvice::IsInliningRecommended
protected

Definition at line 133 of file InlineAdvisor.h.

Referenced by InlineAdvice(), and isInliningRecommended().

◆ ORE


The documentation for this class was generated from the following files: