llvm::getInlineCost

Get an InlineCost with the callee explicitly specified. This allows you to calculate the cost of inlining a function via a pointer. This behaves exactly as the version with no explicit callee parameter in all other respects.

Synopsis

Declared in <llvm/Analysis/InlineCost.h>

InlineCost
getInlineCost(
    CallBase& Call,
    Function* Callee,
    InlineParams const& Params,
    TargetTransformInfo& CalleeTTI,
    function_ref<AssumptionCache&(Function&)> GetAssumptionCache,
    function_ref<TargetLibraryInfo const&(Function&)> GetTLI,
    function_ref<BlockFrequencyInfo&(Function&)> GetBFI = nullptr,
    ProfileSummaryInfo* PSI = nullptr,
    OptimizationRemarkEmitter* ORE = nullptr,
    function_ref<EphemeralValuesCache&(Function&)> GetEphValuesCache = nullptr);

Return Value

Represents the cost of inlining a function.

Parameters

NameDescription
CallBase class for all callable instructions (InvokeInst and CallInst) Holds everything related to calling a function.
ParamsThresholds to tune inline cost analysis. The inline cost analysis decides the condition to apply a threshold and applies it. Otherwise, DefaultThreshold is used. If a threshold is Optional, it is applied only when it has a valid value. Typically, users of inline cost analysis obtain an InlineParams object through one of the getInlineParams methods and pass it to getInlineCost. Some specialized versions of inliner (such as the pre-inliner) might have custom logic to compute InlineParams object.
CalleeTTIThis pass provides access to the codegen interfaces that are needed for IR-level transformations.
GetAssumptionCacheAn efficient, type-erasing, non-owning reference to a callable. This is intended for use as the type of a function parameter that is not used after the function in question returns.
GetTLIAn efficient, type-erasing, non-owning reference to a callable. This is intended for use as the type of a function parameter that is not used after the function in question returns.
GetBFIAn efficient, type-erasing, non-owning reference to a callable. This is intended for use as the type of a function parameter that is not used after the function in question returns.
PSIAnalysis providing profile information.
OREThe optimization diagnostic interface.
GetEphValuesCacheAn efficient, type-erasing, non-owning reference to a callable. This is intended for use as the type of a function parameter that is not used after the function in question returns.