LLVM  12.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for llvm::InlineAdvice:
Collaboration graph
[legend]

Public Member Functions

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

Constructor & Destructor Documentation

◆ InlineAdvice() [1/3]

InlineAdvice::InlineAdvice ( InlineAdvisor Advisor,
CallBase CB,
OptimizationRemarkEmitter ORE,
bool  IsInliningRecommended 
)

Definition at line 113 of file InlineAdvisor.cpp.

◆ InlineAdvice() [2/3]

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

◆ InlineAdvice() [3/3]

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

◆ ~InlineAdvice()

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

Definition at line 62 of file InlineAdvisor.h.

References assert().

Member Function Documentation

◆ getOriginalCallSiteBasicBlock()

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

Definition at line 94 of file InlineAdvisor.h.

References Block.

◆ getOriginalCallSiteDebugLoc()

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

Definition at line 93 of file InlineAdvisor.h.

References DLoc.

◆ isInliningRecommended()

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

Get the inlining recommendation.

Definition at line 92 of file InlineAdvisor.h.

References IsInliningRecommended.

◆ recordInlining()

void llvm::InlineAdvice::recordInlining ( )
inline

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 71 of file InlineAdvisor.h.

References recordInliningImpl().

◆ recordInliningImpl()

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

Reimplemented in llvm::MLInlineAdvice.

Definition at line 97 of file InlineAdvisor.h.

Referenced by recordInlining().

◆ recordInliningWithCalleeDeleted()

void InlineAdvice::recordInliningWithCalleeDeleted ( )

Call after inlining succeeded, and resulted in deleting the callee.

Definition at line 132 of file InlineAdvisor.cpp.

References Advisor, Callee, and recordInliningWithCalleeDeletedImpl().

◆ recordInliningWithCalleeDeletedImpl()

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

Reimplemented in llvm::MLInlineAdvice.

Definition at line 98 of file InlineAdvisor.h.

Referenced by recordInliningWithCalleeDeleted().

◆ recordUnattemptedInlining()

void llvm::InlineAdvice::recordUnattemptedInlining ( )
inline

Call to indicate inlining was not attempted.

Definition at line 86 of file InlineAdvisor.h.

References recordUnattemptedInliningImpl().

◆ recordUnattemptedInliningImpl()

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

Reimplemented in llvm::MLInlineAdvice.

Definition at line 100 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 80 of file InlineAdvisor.h.

References recordUnsuccessfulInliningImpl().

◆ recordUnsuccessfulInliningImpl()

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

Reimplemented in llvm::MLInlineAdvice.

Definition at line 99 of file InlineAdvisor.h.

Referenced by recordUnsuccessfulInlining().

Member Data Documentation

◆ Advisor

InlineAdvisor* const llvm::InlineAdvice::Advisor
protected

Definition at line 102 of file InlineAdvisor.h.

Referenced by recordInliningWithCalleeDeleted().

◆ Block

const BasicBlock* const llvm::InlineAdvice::Block
protected

Definition at line 111 of file InlineAdvisor.h.

Referenced by getOriginalCallSiteBasicBlock().

◆ Callee

Function* const llvm::InlineAdvice::Callee
protected

◆ Caller

Function* const llvm::InlineAdvice::Caller
protected

Caller and Callee are pre-inlining.

Definition at line 104 of file InlineAdvisor.h.

Referenced by llvm::MLInlineAdvice::getCaller(), and getDefaultInlineAdvice().

◆ DLoc

const DebugLoc llvm::InlineAdvice::DLoc
protected

Definition at line 110 of file InlineAdvisor.h.

Referenced by getOriginalCallSiteDebugLoc().

◆ IsInliningRecommended

const bool llvm::InlineAdvice::IsInliningRecommended
protected

Definition at line 113 of file InlineAdvisor.h.

Referenced by isInliningRecommended().

◆ ORE

OptimizationRemarkEmitter& llvm::InlineAdvice::ORE
protected

Definition at line 112 of file InlineAdvisor.h.

Referenced by getDefaultInlineAdvice().


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