llvm::promoteCallWithIfThenElse

promoteCallWithIfThenElse overloads

Synopses

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

Promote an indirect call conditionally while updating contextual profiles.

CallBase*
promoteCallWithIfThenElse(
    CallBase& CB,
    Function& Callee,
    PGOContextualProfile& CtxProf);
» more...

Promote the given indirect call site to conditionally call Callee. The promoted direct call instruction is predicated on `CB.getCalledOperand() == Callee`.

CallBase&
promoteCallWithIfThenElse(
    CallBase& CB,
    Function* Callee,
    MDNode* BranchWeights = nullptr);
» more...

Return Value

  • The promoted direct call, or nullptr if promotion is not possible.
  • The promoted direct call placed in the "then" block.

Parameters

NameDescription
CBIndirect call site to promote conditionally.
CalleeFunction to call on the promoted path.
CtxProfContextual profile used to validate and update instrumentation.
BranchWeightsOptional !prof metadata for the new conditional branch.