class MLInlineAdvisor
Declaration
class MLInlineAdvisor : public InlineAdvisor { /* full declaration omitted */ };
Description
Interface for deciding whether to inline a call site or not.
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:27
Inherits from: InlineAdvisor
Member Variables
- protected std::unique_ptr<MLModelRunner> ModelRunner
- private DenseMap<const llvm::Function*, llvm::FunctionPropertiesInfo> FPICache
- private llvm::LazyCallGraph& CG
- private int64_t NodeCount = 0
- private int64_t EdgeCount = 0
- private int64_t EdgesOfLastSeenNodes = 0
- private std::map<const LazyCallGraph::Node*, unsigned int> FunctionLevels
- private const int32_t InitialIRSize = 0
- private int32_t CurrentIRSize = 0
- private llvm::SmallPtrSet<const LazyCallGraph::Node*, 1> NodesInLastSCC
- private DenseSet<const LazyCallGraph::Node*> AllNodes
- private bool ForceStop = false
Inherited from InlineAdvisor:
- protected M
- protected FAM
- protected IC
- protected AnnotatedInlinePassName
- protected ImportedFunctionsStats
Method Overview
- public MLInlineAdvisor(llvm::Module & M, llvm::ModuleAnalysisManager & MAM, std::unique_ptr<MLModelRunner> ModelRunner)
- protected virtual std::unique_ptr<MLInlineAdvice> getAdviceFromModel(llvm::CallBase & CB, llvm::OptimizationRemarkEmitter & ORE)
- protected std::unique_ptr<InlineAdvice> getAdviceImpl(llvm::CallBase & CB)
- public llvm::FunctionPropertiesInfo & getCachedFPI(llvm::Function &) const
- public int64_t getIRSize(llvm::Function & F) const
- protected unsigned int getInitialFunctionLevel(const llvm::Function & F) const
- public int64_t getLocalCalls(llvm::Function & F)
- protected std::unique_ptr<InlineAdvice> getMandatoryAdvice(llvm::CallBase & CB, bool Advice)
- protected virtual std::unique_ptr<MLInlineAdvice> getMandatoryAdviceImpl(llvm::CallBase & CB)
- public const llvm::MLModelRunner & getModelRunner() const
- private int64_t getModuleIRSize() const
- private std::unique_ptr<InlineAdvice> getSkipAdviceIfUnreachableCallsite(llvm::CallBase & CB)
- public bool isForcedToStop() const
- public void onPassEntry(LazyCallGraph::SCC * SCC)
- public void onPassExit(LazyCallGraph::SCC * SCC)
- public void onSuccessfulInlining(const llvm::MLInlineAdvice & Advice, bool CalleeWasDeleted)
- private void print(llvm::raw_ostream & OS) const
- public virtual ~MLInlineAdvisor()
Inherited from InlineAdvisor:
- public getAdvice
- protected getAdviceImpl
- public getAnnotatedInlinePassName
- protected getCallerORE
- protected getMandatoryAdvice
- protected getMandatoryKind
- public onPassEntry
- public onPassExit
- public print
Methods
¶MLInlineAdvisor(
llvm::Module& M,
llvm::ModuleAnalysisManager& MAM,
std::unique_ptr<MLModelRunner> ModelRunner)
MLInlineAdvisor(
llvm::Module& M,
llvm::ModuleAnalysisManager& MAM,
std::unique_ptr<MLModelRunner> ModelRunner)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:29
Parameters
- llvm::Module& M
- llvm::ModuleAnalysisManager& MAM
- std::unique_ptr<MLModelRunner> ModelRunner
¶virtual std::unique_ptr<MLInlineAdvice>
getAdviceFromModel(
llvm::CallBase& CB,
llvm::OptimizationRemarkEmitter& ORE)
virtual std::unique_ptr<MLInlineAdvice>
getAdviceFromModel(
llvm::CallBase& CB,
llvm::OptimizationRemarkEmitter& ORE)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:57
Parameters
¶std::unique_ptr<InlineAdvice> getAdviceImpl(
llvm::CallBase& CB)
std::unique_ptr<InlineAdvice> getAdviceImpl(
llvm::CallBase& CB)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:49
Parameters
- llvm::CallBase& CB
¶llvm::FunctionPropertiesInfo& getCachedFPI(
llvm::Function&) const
llvm::FunctionPropertiesInfo& getCachedFPI(
llvm::Function&) const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:46
Parameters
¶int64_t getIRSize(llvm::Function& F) const
int64_t getIRSize(llvm::Function& F) const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:37
Parameters
¶unsigned int getInitialFunctionLevel(
const llvm::Function& F) const
unsigned int getInitialFunctionLevel(
const llvm::Function& F) const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:62
Parameters
- const llvm::Function& F
¶int64_t getLocalCalls(llvm::Function& F)
int64_t getLocalCalls(llvm::Function& F)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:44
Parameters
¶std::unique_ptr<InlineAdvice> getMandatoryAdvice(
llvm::CallBase& CB,
bool Advice)
std::unique_ptr<InlineAdvice> getMandatoryAdvice(
llvm::CallBase& CB,
bool Advice)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:51
Parameters
- llvm::CallBase& CB
- bool Advice
¶virtual std::unique_ptr<MLInlineAdvice>
getMandatoryAdviceImpl(llvm::CallBase& CB)
virtual std::unique_ptr<MLInlineAdvice>
getMandatoryAdviceImpl(llvm::CallBase& CB)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:54
Parameters
- llvm::CallBase& CB
¶const llvm::MLModelRunner& getModelRunner() const
const llvm::MLModelRunner& getModelRunner() const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:45
¶int64_t getModuleIRSize() const
int64_t getModuleIRSize() const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:67
¶std::unique_ptr<InlineAdvice>
getSkipAdviceIfUnreachableCallsite(
llvm::CallBase& CB)
std::unique_ptr<InlineAdvice>
getSkipAdviceIfUnreachableCallsite(
llvm::CallBase& CB)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:69
Parameters
- llvm::CallBase& CB
¶bool isForcedToStop() const
bool isForcedToStop() const
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:43
¶void onPassEntry(LazyCallGraph::SCC* SCC)
void onPassEntry(LazyCallGraph::SCC* SCC)
Description
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).
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:34
Parameters
- LazyCallGraph::SCC* SCC
¶void onPassExit(LazyCallGraph::SCC* SCC)
void onPassExit(LazyCallGraph::SCC* SCC)
Description
This must be called when the Inliner pass is exited, as function passes may be run subsequently. This allows an implementation of InlineAdvisor to prepare for a partial update, based on the optional SCC.
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:35
Parameters
- LazyCallGraph::SCC* SCC
¶void onSuccessfulInlining(
const llvm::MLInlineAdvice& Advice,
bool CalleeWasDeleted)
void onSuccessfulInlining(
const llvm::MLInlineAdvice& Advice,
bool CalleeWasDeleted)
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:40
Parameters
- const llvm::MLInlineAdvice& Advice
- bool CalleeWasDeleted
¶void print(llvm::raw_ostream& OS) const
void print(llvm::raw_ostream& OS) const
Description
Support for printer pass
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:70
Parameters
¶virtual ~MLInlineAdvisor()
virtual ~MLInlineAdvisor()
Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:32