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

Inherited from InlineAdvisor:

Methods

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)

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:57

Parameters

llvm::CallBase& CB
llvm::OptimizationRemarkEmitter& ORE

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

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:46

Parameters

llvm::Function&

int64_t getIRSize(llvm::Function& F) const

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:37

Parameters

llvm::Function& F

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)

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:44

Parameters

llvm::Function& F

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)

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:54

Parameters

llvm::CallBase& CB

const llvm::MLModelRunner& getModelRunner() const

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:45

int64_t getModuleIRSize() const

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:67

std::unique_ptr<InlineAdvice>
getSkipAdviceIfUnreachableCallsite(
    llvm::CallBase& CB)

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:69

Parameters

llvm::CallBase& CB

bool isForcedToStop() const

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:43

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)

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)

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:40

Parameters

const llvm::MLInlineAdvice& Advice
bool CalleeWasDeleted

void print(llvm::raw_ostream& OS) const

Description

Support for printer pass

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:70

Parameters

llvm::raw_ostream& OS

virtual ~MLInlineAdvisor()

Declared at: llvm/include/llvm/Analysis/MLInlineAdvisor.h:32