LLVM
12.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 | |
InlineAdvice (InlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool IsInliningRecommended) | |
InlineAdvice (InlineAdvice &&)=delete | |
InlineAdvice (const InlineAdvice &)=delete | |
virtual | ~InlineAdvice () |
void | recordInlining () |
Exactly one of the record* APIs must be called. More... | |
void | recordInliningWithCalleeDeleted () |
Call after inlining succeeded, and resulted in deleting the callee. More... | |
void | recordUnsuccessfulInlining (const InlineResult &Result) |
Call after the decision for a call site was to not inline. More... | |
void | recordUnattemptedInlining () |
Call to indicate inlining was not attempted. More... | |
bool | isInliningRecommended () const |
Get the inlining recommendation. More... | |
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. More... | |
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 55 of file InlineAdvisor.h.
InlineAdvice::InlineAdvice | ( | InlineAdvisor * | Advisor, |
CallBase & | CB, | ||
OptimizationRemarkEmitter & | ORE, | ||
bool | IsInliningRecommended | ||
) |
Definition at line 113 of file InlineAdvisor.cpp.
|
delete |
|
delete |
|
inlinevirtual |
Definition at line 62 of file InlineAdvisor.h.
References assert().
|
inline |
Definition at line 94 of file InlineAdvisor.h.
References Block.
Definition at line 93 of file InlineAdvisor.h.
References DLoc.
|
inline |
Get the inlining recommendation.
Definition at line 92 of file InlineAdvisor.h.
References IsInliningRecommended.
|
inline |
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 71 of file InlineAdvisor.h.
References recordInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 97 of file InlineAdvisor.h.
Referenced by recordInlining().
void InlineAdvice::recordInliningWithCalleeDeleted | ( | ) |
Call after inlining succeeded, and resulted in deleting the callee.
Definition at line 132 of file InlineAdvisor.cpp.
References Advisor, Callee, and recordInliningWithCalleeDeletedImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 98 of file InlineAdvisor.h.
Referenced by recordInliningWithCalleeDeleted().
|
inline |
Call to indicate inlining was not attempted.
Definition at line 86 of file InlineAdvisor.h.
References recordUnattemptedInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 100 of file InlineAdvisor.h.
Referenced by recordUnattemptedInlining().
|
inline |
Call after the decision for a call site was to not inline.
Definition at line 80 of file InlineAdvisor.h.
References recordUnsuccessfulInliningImpl().
|
inlineprotectedvirtual |
Reimplemented in llvm::MLInlineAdvice.
Definition at line 99 of file InlineAdvisor.h.
Referenced by recordUnsuccessfulInlining().
|
protected |
Definition at line 102 of file InlineAdvisor.h.
Referenced by recordInliningWithCalleeDeleted().
|
protected |
Definition at line 111 of file InlineAdvisor.h.
Referenced by getOriginalCallSiteBasicBlock().
Definition at line 105 of file InlineAdvisor.h.
Referenced by llvm::MLInlineAdvice::getCallee(), getDefaultInlineAdvice(), and recordInliningWithCalleeDeleted().
Caller and Callee are pre-inlining.
Definition at line 104 of file InlineAdvisor.h.
Referenced by llvm::MLInlineAdvice::getCaller(), and getDefaultInlineAdvice().
Definition at line 110 of file InlineAdvisor.h.
Referenced by getOriginalCallSiteDebugLoc().
Definition at line 113 of file InlineAdvisor.h.
Referenced by isInliningRecommended().
|
protected |
Definition at line 112 of file InlineAdvisor.h.
Referenced by getDefaultInlineAdvice().