LLVM  14.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::MLInlineAdvisor Class Reference

#include "llvm/Analysis/MLInlineAdvisor.h"

Inheritance diagram for llvm::MLInlineAdvisor:
Inheritance graph
[legend]
Collaboration diagram for llvm::MLInlineAdvisor:
Collaboration graph
[legend]

Public Member Functions

 MLInlineAdvisor (Module &M, ModuleAnalysisManager &MAM, std::unique_ptr< MLModelRunner > ModelRunner)
 
CallGraphcallGraph () const
 
virtual ~MLInlineAdvisor ()=default
 
void onPassEntry () override
 This must be called when the Inliner pass is entered, to allow the InlineAdvisor update internal state, as result of function passes run between Inliner pass runs (for the same module). More...
 
int64_t getIRSize (const Function &F) const
 
void onSuccessfulInlining (const MLInlineAdvice &Advice, bool CalleeWasDeleted)
 
bool isForcedToStop () const
 
int64_t getLocalCalls (Function &F)
 
const MLModelRunnergetModelRunner () const
 
- Public Member Functions inherited from llvm::InlineAdvisor
 InlineAdvisor (InlineAdvisor &&)=delete
 
virtual ~InlineAdvisor ()
 
std::unique_ptr< InlineAdvicegetAdvice (CallBase &CB, bool MandatoryOnly=false)
 Get an InlineAdvice containing a recommendation on whether to inline or not. More...
 
virtual void onPassExit ()
 This must be called when the Inliner pass is exited, as function passes may be run subsequently. More...
 

Protected Member Functions

std::unique_ptr< InlineAdvicegetAdviceImpl (CallBase &CB) override
 
std::unique_ptr< InlineAdvicegetMandatoryAdvice (CallBase &CB, bool Advice) override
 
virtual std::unique_ptr< MLInlineAdvicegetMandatoryAdviceImpl (CallBase &CB)
 
virtual std::unique_ptr< MLInlineAdvicegetAdviceFromModel (CallBase &CB, OptimizationRemarkEmitter &ORE)
 
- Protected Member Functions inherited from llvm::InlineAdvisor
 InlineAdvisor (Module &M, FunctionAnalysisManager &FAM)
 
void freeDeletedFunctions ()
 We may want to defer deleting functions to after the inlining for a whole module has finished. More...
 
bool isFunctionDeleted (const Function *F) const
 
OptimizationRemarkEmittergetCallerORE (CallBase &CB)
 

Protected Attributes

std::unique_ptr< MLModelRunnerModelRunner
 
- Protected Attributes inherited from llvm::InlineAdvisor
ModuleM
 
FunctionAnalysisManagerFAM
 
std::unique_ptr< ImportedFunctionsInliningStatisticsImportedFunctionsStats
 

Additional Inherited Members

- Protected Types inherited from llvm::InlineAdvisor
enum  MandatoryInliningKind { MandatoryInliningKind::NotMandatory, MandatoryInliningKind::Always, MandatoryInliningKind::Never }
 
- Static Protected Member Functions inherited from llvm::InlineAdvisor
static MandatoryInliningKind getMandatoryKind (CallBase &CB, FunctionAnalysisManager &FAM, OptimizationRemarkEmitter &ORE)
 

Detailed Description

Definition at line 24 of file MLInlineAdvisor.h.

Constructor & Destructor Documentation

◆ MLInlineAdvisor()

llvm::MLInlineAdvisor::MLInlineAdvisor ( Module M,
ModuleAnalysisManager MAM,
std::unique_ptr< MLModelRunner ModelRunner 
)

◆ ~MLInlineAdvisor()

virtual llvm::MLInlineAdvisor::~MLInlineAdvisor ( )
virtualdefault

Member Function Documentation

◆ callGraph()

CallGraph* llvm::MLInlineAdvisor::callGraph ( ) const
inline

Definition at line 29 of file MLInlineAdvisor.h.

◆ getAdviceFromModel()

virtual std::unique_ptr<MLInlineAdvice> llvm::MLInlineAdvisor::getAdviceFromModel ( CallBase CB,
OptimizationRemarkEmitter ORE 
)
protectedvirtual

◆ getAdviceImpl()

std::unique_ptr<InlineAdvice> llvm::MLInlineAdvisor::getAdviceImpl ( CallBase CB)
overrideprotectedvirtual

Implements llvm::InlineAdvisor.

◆ getIRSize()

int64_t llvm::MLInlineAdvisor::getIRSize ( const Function F) const
inline

Definition at line 34 of file MLInlineAdvisor.h.

References F.

◆ getLocalCalls()

int64_t llvm::MLInlineAdvisor::getLocalCalls ( Function F)

◆ getMandatoryAdvice()

std::unique_ptr<InlineAdvice> llvm::MLInlineAdvisor::getMandatoryAdvice ( CallBase CB,
bool  Advice 
)
overrideprotectedvirtual

Reimplemented from llvm::InlineAdvisor.

◆ getMandatoryAdviceImpl()

virtual std::unique_ptr<MLInlineAdvice> llvm::MLInlineAdvisor::getMandatoryAdviceImpl ( CallBase CB)
protectedvirtual

◆ getModelRunner()

const MLModelRunner& llvm::MLInlineAdvisor::getModelRunner ( ) const
inline

Definition at line 40 of file MLInlineAdvisor.h.

References ModelRunner.

◆ isForcedToStop()

bool llvm::MLInlineAdvisor::isForcedToStop ( ) const
inline

Definition at line 38 of file MLInlineAdvisor.h.

◆ onPassEntry()

void llvm::MLInlineAdvisor::onPassEntry ( )
overridevirtual

This must be called when the Inliner pass is entered, to allow the InlineAdvisor update internal state, as result of function passes run between Inliner pass runs (for the same module).

Reimplemented from llvm::InlineAdvisor.

◆ onSuccessfulInlining()

void llvm::MLInlineAdvisor::onSuccessfulInlining ( const MLInlineAdvice Advice,
bool  CalleeWasDeleted 
)

Member Data Documentation

◆ ModelRunner

std::unique_ptr<MLModelRunner> llvm::MLInlineAdvisor::ModelRunner
protected

Definition at line 53 of file MLInlineAdvisor.h.

Referenced by getModelRunner().


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