14 #ifndef LLVM_ANALYSIS_INLINECOST_H
15 #define LLVM_ANALYSIS_INLINECOST_H
22 class AssumptionCacheTracker;
26 class TargetTransformInfoWrapperPass;
28 namespace InlineConstants {
53 AlwaysInlineCost = INT_MIN,
54 NeverInlineCost = INT_MAX
64 InlineCost(
int Cost,
int Threshold) : Cost(Cost), Threshold(Threshold) {}
68 assert(Cost > AlwaysInlineCost &&
"Cost crosses sentinel value");
69 assert(Cost < NeverInlineCost &&
"Cost crosses sentinel value");
80 explicit operator bool()
const {
81 return Cost < Threshold;
84 bool isAlways()
const {
return Cost == AlwaysInlineCost; }
85 bool isNever()
const {
return Cost == NeverInlineCost; }
91 assert(
isVariable() &&
"Invalid access of InlineCost");
An immutable pass that tracks lazily created AssumptionCache objects.
Represents the cost of inlining a function.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - For this class, we declare that we require and preserve the call graph...
int getCost() const
Get the inline cost estimate.
const int LastCallToStaticBonus
int getCostDelta() const
Get the cost delta from the threshold for inlining.
bool isInlineViable(Function &Callee)
Minimal filter to detect invalid constructs for inlining.
const int IndirectCallThreshold
Cost analyzer used by inliner.
Represent the analysis usage information of a pass.
static InlineCost getNever()
bool runOnSCC(CallGraphSCC &SCC) override
runOnSCC - This method should be implemented by the subclass to perform whatever action is necessary ...
~InlineCostAnalysis() override
InlineCost getInlineCost(CallSite CS, int Threshold)
Get an InlineCost object representing the cost of inlining this callsite.
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...
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
static InlineCost getAlways()
const int NoreturnPenalty