LLVM
15.0.0git
|
Replay inline advisor that uses optimization remarks from inlining of previous build to guide current inlining. More...
#include "llvm/Analysis/ReplayInlineAdvisor.h"
Public Member Functions | |
ReplayInlineAdvisor (Module &M, FunctionAnalysisManager &FAM, LLVMContext &Context, std::unique_ptr< InlineAdvisor > OriginalAdvisor, const ReplayInlinerSettings &ReplaySettings, bool EmitRemarks) | |
std::unique_ptr< InlineAdvice > | getAdviceImpl (CallBase &CB) override |
bool | areReplayRemarksLoaded () const |
![]() | |
InlineAdvisor (InlineAdvisor &&)=delete | |
virtual | ~InlineAdvisor () |
std::unique_ptr< InlineAdvice > | getAdvice (CallBase &CB, bool MandatoryOnly=false) |
Get an InlineAdvice containing a recommendation on whether to inline or not. More... | |
virtual void | onPassEntry () |
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... | |
virtual void | onPassExit (LazyCallGraph::SCC *SCC=nullptr) |
This must be called when the Inliner pass is exited, as function passes may be run subsequently. More... | |
virtual void | print (raw_ostream &OS) const |
Support for printer pass. More... | |
Additional Inherited Members | |
![]() | |
enum | MandatoryInliningKind { MandatoryInliningKind::NotMandatory, MandatoryInliningKind::Always, MandatoryInliningKind::Never } |
![]() | |
InlineAdvisor (Module &M, FunctionAnalysisManager &FAM) | |
virtual std::unique_ptr< InlineAdvice > | getMandatoryAdvice (CallBase &CB, bool Advice) |
OptimizationRemarkEmitter & | getCallerORE (CallBase &CB) |
![]() | |
static MandatoryInliningKind | getMandatoryKind (CallBase &CB, FunctionAnalysisManager &FAM, OptimizationRemarkEmitter &ORE) |
![]() | |
Module & | M |
FunctionAnalysisManager & | FAM |
std::unique_ptr< ImportedFunctionsInliningStatistics > | ImportedFunctionsStats |
Replay inline advisor that uses optimization remarks from inlining of previous build to guide current inlining.
This is useful for inliner tuning.
Definition at line 63 of file ReplayInlineAdvisor.h.
ReplayInlineAdvisor::ReplayInlineAdvisor | ( | Module & | M, |
FunctionAnalysisManager & | FAM, | ||
LLVMContext & | Context, | ||
std::unique_ptr< InlineAdvisor > | OriginalAdvisor, | ||
const ReplayInlinerSettings & | ReplaySettings, | ||
bool | EmitRemarks | ||
) |
Definition at line 26 of file ReplayInlineAdvisor.cpp.
References Callee, Context, llvm::LLVMContext::emitError(), llvm::ReplayInlinerSettings::Function, llvm::MemoryBuffer::getFileOrSTDIN(), llvm::StringSet< AllocatorTy >::insert(), llvm::line_iterator::is_at_eof(), M, llvm::ReplayInlinerSettings::ReplayFile, llvm::ReplayInlinerSettings::ReplayScope, and llvm::StringRef::split().
|
inline |
Definition at line 71 of file ReplayInlineAdvisor.h.
|
overridevirtual |
Implements llvm::InlineAdvisor.
Definition at line 89 of file ReplayInlineAdvisor.cpp.
References llvm::ReplayInlinerSettings::AlwaysInline, assert(), Callee, llvm::dbgs(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::InlineAdvisor::FAM, llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::formatCallSiteLocation(), llvm::InlineCost::getAlways(), llvm::CallBase::getCalledFunction(), llvm::CallBase::getCaller(), llvm::Instruction::getDebugLoc(), llvm::Instruction::getFunction(), llvm::Value::getName(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), LLVM_DEBUG, llvm::ReplayInlinerSettings::NeverInline, llvm::None, llvm::ReplayInlinerSettings::Original, llvm::ReplayInlinerSettings::ReplayFallback, and llvm::ReplayInlinerSettings::ReplayFormat.