14 #ifndef LLVM_ANALYSIS_INLINECOST_H 15 #define LLVM_ANALYSIS_INLINECOST_H 24 class AssumptionCacheTracker;
25 class BlockFrequencyInfo;
29 class ProfileSummaryInfo;
30 class TargetTransformInfo;
32 namespace InlineConstants {
67 AlwaysInlineCost = INT_MIN,
68 NeverInlineCost = INT_MAX
82 assert(Cost > AlwaysInlineCost &&
"Cost crosses sentinel value");
83 assert(Cost < NeverInlineCost &&
"Cost crosses sentinel value");
94 explicit operator bool()
const {
98 bool isAlways()
const {
return Cost == AlwaysInlineCost; }
99 bool isNever()
const {
return Cost == NeverInlineCost; }
100 bool isVariable()
const {
return !isAlways() && !isNever(); }
105 assert(isVariable() &&
"Invalid access of InlineCost");
111 assert(isVariable() &&
"Invalid access of InlineCost");
A parsed version of the target data layout string in and methods for querying it. ...
Thresholds to tune inline cost analysis.
Compute iterated dominance frontiers using a linear time algorithm.
Optional< int > OptSizeThreshold
Threshold to use when the caller is optimized for size.
Analysis providing profile information.
const int OptMinSizeThreshold
Use when minsize (-Oz) is specified.
An efficient, type-erasing, non-owning reference to a callable.
A cache of @llvm.assume calls within a function.
Represents the cost of inlining a function.
Optional< int > HintThreshold
Threshold to use for callees with inline hint.
bool isInlineViable(Function &Callee)
Minimal filter to detect invalid constructs for inlining.
const int LastCallToStaticBonus
amdgpu Simplify well known AMD library false Value * Callee
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
const int IndirectCallThreshold
const int OptAggressiveThreshold
Use when -O3 is specified.
Optional< int > OptMinSizeThreshold
Threshold to use when the caller is optimized for minsize.
static InlineCost getNever()
Optional< int > LocallyHotCallSiteThreshold
Threshold to use when the callsite is considered hot relative to function entry.
int getThreshold() const
Get the threshold against which the cost was computed.
InlineCost getInlineCost(CallSite CS, const InlineParams &Params, TargetTransformInfo &CalleeTTI, std::function< AssumptionCache &(Function &)> &GetAssumptionCache, Optional< function_ref< BlockFrequencyInfo &(Function &)>> GetBFI, ProfileSummaryInfo *PSI, OptimizationRemarkEmitter *ORE=nullptr)
Get an InlineCost object representing the cost of inlining this callsite.
Optional< bool > ComputeFullInlineCost
Compute inline cost even when the cost has exceeded the threshold.
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options...
Optional< int > ColdThreshold
Threshold to use for cold callees.
int getCost() const
Get the inline cost estimate.
int getCostDelta() const
Get the cost delta from the threshold for inlining.
int getCallsiteCost(CallSite CS, const DataLayout &DL)
Return the cost associated with a callsite, including parameter passing and the call/return instructi...
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
const unsigned TotalAllocaSizeRecursiveCaller
Do not inline functions which allocate this many bytes on the stack when the caller is recursive...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Optional< int > ColdCallSiteThreshold
Threshold to use when the callsite is considered cold.
print Print MemDeps of function
const int OptSizeThreshold
Use when optsize (-Os) is specified.
static InlineCost getAlways()
const int NoreturnPenalty
Optional< int > HotCallSiteThreshold
Threshold to use when the callsite is considered hot.
int DefaultThreshold
The default threshold to start with for a callee.