Get an InlineCost object representing the cost of inlining this callsite.
Synopsis
Declared in <llvm/Analysis/InlineCost.h>
InlineCost
getInlineCost(
CallBase& Call,
InlineParams const& Params,
TargetTransformInfo& CalleeTTI,
function_ref<AssumptionCache&(xref:llvm/Function.adoc[Function&)>] GetAssumptionCache,
function_ref<TargetLibraryInfo const&(xref:llvm/Function.adoc[Function&)>] GetTLI,
function_ref<BlockFrequencyInfo&(xref:llvm/Function.adoc[Function&)>] GetBFI = nullptr,
ProfileSummaryInfo* PSI = nullptr,
OptimizationRemarkEmitter* ORE = nullptr,
function_ref<EphemeralValuesCache&(xref:llvm/Function.adoc[Function&)>] GetEphValuesCache = nullptr);
Description
Note that a default threshold is passed into this function. This threshold could be modified based on callsite's properties and only costs below this new threshold are computed with any accuracy. The new threshold can be used to bound the computation necessary to determine whether the cost is sufficiently low to warrant inlining.
Also note that calling this function dynamically computes the cost of inlining the callsite. It is an expensive, heavyweight call.
Return Value
The computed InlineCost for Call.
Parameters
Name |
Description |
Call |
Call site whose inlining cost is computed. |
Params |
Thresholds and knobs that tune the cost analysis. |
CalleeTTI |
Target transform info for the callee. |
GetAssumptionCache |
Callback returning the assumption cache for a function. |
GetTLI |
Callback returning target library info for a function. |
GetBFI |
Optional callback returning block frequency info, or null. |
PSI |
Optional profile summary used for hot/cold callsite thresholds. |
ORE |
Optional remark emitter for inlining diagnostics. |
GetEphValuesCache |
Optional callback returning the ephemeral values cache for a function. |
Created with MrDocs