LLVM 20.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, InlineContext IC) | |
std::unique_ptr< InlineAdvice > | getAdviceImpl (CallBase &CB) override |
bool | areReplayRemarksLoaded () const |
Public Member Functions inherited from llvm::InlineAdvisor | |
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. | |
virtual void | onPassEntry (LazyCallGraph::SCC *SCC=nullptr) |
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). | |
virtual void | onPassExit (LazyCallGraph::SCC *SCC=nullptr) |
This must be called when the Inliner pass is exited, as function passes may be run subsequently. | |
virtual void | print (raw_ostream &OS) const |
Support for printer pass. | |
const char * | getAnnotatedInlinePassName () const |
NOTE pass name is annotated only when inline advisor constructor provides InlineContext. | |
Additional Inherited Members | |
Protected Types inherited from llvm::InlineAdvisor | |
enum class | MandatoryInliningKind { NotMandatory , Always , Never } |
Protected Member Functions inherited from llvm::InlineAdvisor | |
InlineAdvisor (Module &M, FunctionAnalysisManager &FAM, std::optional< InlineContext > IC=std::nullopt) | |
virtual std::unique_ptr< InlineAdvice > | getAdviceImpl (CallBase &CB)=0 |
virtual std::unique_ptr< InlineAdvice > | getMandatoryAdvice (CallBase &CB, bool Advice) |
OptimizationRemarkEmitter & | getCallerORE (CallBase &CB) |
Static Protected Member Functions inherited from llvm::InlineAdvisor | |
static MandatoryInliningKind | getMandatoryKind (CallBase &CB, FunctionAnalysisManager &FAM, OptimizationRemarkEmitter &ORE) |
Protected Attributes inherited from llvm::InlineAdvisor | |
Module & | M |
FunctionAnalysisManager & | FAM |
const std::optional< InlineContext > | IC |
const std::string | AnnotatedInlinePassName |
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 65 of file ReplayInlineAdvisor.h.
ReplayInlineAdvisor::ReplayInlineAdvisor | ( | Module & | M, |
FunctionAnalysisManager & | FAM, | ||
LLVMContext & | Context, | ||
std::unique_ptr< InlineAdvisor > | OriginalAdvisor, | ||
const ReplayInlinerSettings & | ReplaySettings, | ||
bool | EmitRemarks, | ||
InlineContext | IC | ||
) |
Definition at line 26 of file ReplayInlineAdvisor.cpp.
References llvm::LLVMContext::emitError(), llvm::ReplayInlinerSettings::Function, llvm::MemoryBuffer::getFileOrSTDIN(), llvm::StringSet< AllocatorTy >::insert(), llvm::line_iterator::is_at_eof(), llvm::ReplayInlinerSettings::ReplayFile, and llvm::ReplayInlinerSettings::ReplayScope.
|
inline |
Definition at line 73 of file ReplayInlineAdvisor.h.
|
overridevirtual |
Implements llvm::InlineAdvisor.
Definition at line 93 of file ReplayInlineAdvisor.cpp.
References llvm::ReplayInlinerSettings::AlwaysInline, assert(), 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::ReplayInlinerSettings::Original, llvm::ReplayInlinerSettings::ReplayFallback, and llvm::ReplayInlinerSettings::ReplayFormat.