Get the cost estimate ignoring thresholds.
Declared in <llvm/Analysis/InlineCost.h>
std::optional<int>
getInliningCostEstimate(
CallBase& Call,
TargetTransformInfo& CalleeTTI,
function_ref<AssumptionCache&(Function&)> GetAssumptionCache,
function_ref<BlockFrequencyInfo&(Function&)> GetBFI = nullptr,
function_ref<TargetLibraryInfo const&(Function&)> GetTLI = nullptr,
ProfileSummaryInfo* PSI = nullptr,
OptimizationRemarkEmitter* ORE = nullptr);
This is similar to getInlineCost when passed InlineParams::ComputeFullInlineCost, or a non-null ORE. It uses default InlineParams otherwise. Contrary to getInlineCost, which makes a threshold-based final evaluation of should/shouldn't inline, captured in InlineResult, getInliningCostEstimate returns:
std::nullopt, if the inlining cannot happen (is illegal)
an integer, representing the cost.
The estimated cost, or std::nullopt if inlining is illegal.
| Name | Description |
|---|---|
| Call | Call site whose inlining cost is estimated. |
| CalleeTTI | Target transform info for the callee. |
| GetAssumptionCache | Callback returning the assumption cache for a function. |
| GetBFI | Optional callback returning block frequency info, or null. |
| GetTLI | Optional callback returning target library info, or null. |
| PSI | Optional profile summary used for hot/cold callsite thresholds. |
| ORE | Optional remark emitter for inlining diagnostics. |