LLVM 22.0.0git
|
Capture state between an inlining decision having had been made, and its impact being observable. More...
#include "llvm/Analysis/InlineAdvisor.h"
Public Member Functions | |
LLVM_ABI | InlineAdvice (InlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool IsInliningRecommended) |
InlineAdvice (InlineAdvice &&)=delete | |
InlineAdvice (const InlineAdvice &)=delete | |
virtual | ~InlineAdvice () |
LLVM_ABI void | recordInlining () |
Exactly one of the record* APIs must be called. | |
LLVM_ABI void | recordInliningWithCalleeDeleted () |
Call after inlining succeeded, and results in the callee being delete-able, meaning, it has no more users, and will be cleaned up subsequently. | |
void | recordUnsuccessfulInlining (const InlineResult &Result) |
Call after the decision for a call site was to not inline. | |
void | recordUnattemptedInlining () |
Call to indicate inlining was not attempted. | |
bool | isInliningRecommended () const |
Get the inlining recommendation. | |
const DebugLoc & | getOriginalCallSiteDebugLoc () const |
const BasicBlock * | getOriginalCallSiteBasicBlock () const |
Protected Member Functions | |
virtual void | recordInliningImpl () |
virtual void | recordInliningWithCalleeDeletedImpl () |
virtual void | recordUnsuccessfulInliningImpl (const InlineResult &Result) |
virtual void | recordUnattemptedInliningImpl () |
Protected Attributes | |
InlineAdvisor *const | Advisor |
Function *const | Caller |
Caller and Callee are pre-inlining. | |
Function *const | Callee |
const DebugLoc | DLoc |
const BasicBlock *const | Block |
OptimizationRemarkEmitter & | ORE |
const bool | IsInliningRecommended |
Capture state between an inlining decision having had been made, and its impact being observable.
When collecting model training data, this allows recording features/decisions/partial reward data sets.
Derivations of this type are expected to be tightly coupled with their InliningAdvisors. The base type implements the minimal contractual obligations.
Definition at line 75 of file InlineAdvisor.h.
InlineAdvice::InlineAdvice | ( | InlineAdvisor * | Advisor, |
CallBase & | CB, | ||
OptimizationRemarkEmitter & | ORE, | ||
bool | IsInliningRecommended ) |
Definition at line 190 of file InlineAdvisor.cpp.
References Advisor, Block, Callee, Caller, DLoc, getCalledFunction(), getDebugLoc(), getParent(), IsInliningRecommended, and ORE.
Referenced by llvm::DefaultInlineAdvice::DefaultInlineAdvice(), InlineAdvice(), InlineAdvice(), and llvm::MLInlineAdvice::MLInlineAdvice().
|
delete |
References InlineAdvice().
|
delete |
References InlineAdvice().
|
inlinevirtual |
Definition at line 83 of file InlineAdvisor.h.
References assert().
|
inline |
Definition at line 114 of file InlineAdvisor.h.
References Block.
Definition at line 113 of file InlineAdvisor.h.
References DLoc.
|
inline |
Get the inlining recommendation.
Definition at line 112 of file InlineAdvisor.h.
References IsInliningRecommended.
void InlineAdvice::recordInlining | ( | ) |
Exactly one of the record* APIs must be called.
Implementers may extend behavior by implementing the corresponding record*Impl.
Call after inlining succeeded, and did not result in deleting the callee.
Definition at line 202 of file InlineAdvisor.cpp.
References recordInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 117 of file InlineAdvisor.h.
Referenced by recordInlining().
void InlineAdvice::recordInliningWithCalleeDeleted | ( | ) |
Call after inlining succeeded, and results in the callee being delete-able, meaning, it has no more users, and will be cleaned up subsequently.
Definition at line 208 of file InlineAdvisor.cpp.
References recordInliningWithCalleeDeletedImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 118 of file InlineAdvisor.h.
Referenced by recordInliningWithCalleeDeleted().
|
inline |
Call to indicate inlining was not attempted.
Definition at line 106 of file InlineAdvisor.h.
References recordUnattemptedInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 120 of file InlineAdvisor.h.
Referenced by recordUnattemptedInlining().
|
inline |
Call after the decision for a call site was to not inline.
Definition at line 100 of file InlineAdvisor.h.
References recordUnsuccessfulInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 119 of file InlineAdvisor.h.
Referenced by recordUnsuccessfulInlining().
|
protected |
Definition at line 122 of file InlineAdvisor.h.
Referenced by llvm::DefaultInlineAdvice::DefaultInlineAdvice(), InlineAdvice(), and llvm::MLInlineAdvice::MLInlineAdvice().
|
protected |
Definition at line 131 of file InlineAdvisor.h.
Referenced by getOriginalCallSiteBasicBlock(), InlineAdvice(), llvm::MLInlineAdvice::recordInliningImpl(), llvm::MLInlineAdvice::recordInliningWithCalleeDeletedImpl(), llvm::MLInlineAdvice::recordUnattemptedInliningImpl(), and llvm::MLInlineAdvice::recordUnsuccessfulInliningImpl().
Definition at line 125 of file InlineAdvisor.h.
Referenced by llvm::MLInlineAdvice::getCallee(), InlineAdvice(), and llvm::MLInlineAdvice::MLInlineAdvice().
Caller and Callee are pre-inlining.
Definition at line 124 of file InlineAdvisor.h.
Referenced by llvm::MLInlineAdvice::getCaller(), InlineAdvice(), llvm::MLInlineAdvice::MLInlineAdvice(), and llvm::MLInlineAdvice::recordUnsuccessfulInliningImpl().
Definition at line 130 of file InlineAdvisor.h.
Referenced by getOriginalCallSiteDebugLoc(), InlineAdvice(), llvm::MLInlineAdvice::recordInliningImpl(), llvm::MLInlineAdvice::recordInliningWithCalleeDeletedImpl(), llvm::MLInlineAdvice::recordUnattemptedInliningImpl(), and llvm::MLInlineAdvice::recordUnsuccessfulInliningImpl().
Definition at line 133 of file InlineAdvisor.h.
Referenced by InlineAdvice(), and isInliningRecommended().
|
protected |
Definition at line 132 of file InlineAdvisor.h.
Referenced by llvm::DefaultInlineAdvice::DefaultInlineAdvice(), InlineAdvice(), llvm::MLInlineAdvice::MLInlineAdvice(), llvm::MLInlineAdvice::recordInliningImpl(), llvm::MLInlineAdvice::recordInliningWithCalleeDeletedImpl(), llvm::MLInlineAdvice::recordUnattemptedInliningImpl(), and llvm::MLInlineAdvice::recordUnsuccessfulInliningImpl().