llvm::InlineFunction

Inline CB while also updating a contextual profile.

Synopsis

Declared in <llvm/Transforms/Utils/Cloning.h>

InlineResult
InlineFunction(
    CallBase& CB,
    InlineFunctionInfo& IFI,
    PGOContextualProfile& CtxProf,
    bool MergeAttributes = false,
    AAResults* CalleeAAR = nullptr,
    bool InsertLifetime = true,
    bool TrackInlineHistory = false,
    Function* ForwardVarArgsTo = nullptr,
    OptimizationRemarkEmitter* ORE = nullptr);

Description

Same as above, but it will update the contextual profile. If the contextual profile is invalid (i.e. not loaded because it is not present), it defaults to the behavior of the non-contextual profile updating variant above. This makes it easy to drop-in replace uses of the non-contextual overload.

Return Value

Success if the call was inlined, otherwise a failure reason.

Parameters

NameDescription
CBCall site whose callee should be inlined.
IFIInlining context and result collector.
CtxProfContextual profile to update for the inlined callsite.
MergeAttributesWhether to merge callee attributes into the caller.
CalleeAAROptional alias-analysis results for the callee.
InsertLifetimeWhether to insert lifetime markers for inlined allocas.
TrackInlineHistoryWhether to record inline history metadata.
ForwardVarArgsToIf set, forward varargs from the callsite to calls to this function.
OREOptional optimization-remark emitter for diagnostics.