llvm::versionCallSite

Predicate and clone the given call site.

Synopsis

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

CallBase&
versionCallSite(
    CallBase& CB,
    Value* Callee,
    MDNode* BranchWeights);

Description

This function creates an if-then-else structure at the location of the call site. The "if" condition compares the call site's called value to the given callee. The original call site is moved into the "else" block, and a clone of the call site is placed in the "then" block. The cloned instruction is returned.

Return Value

The cloned call site placed in the "then" block.

Parameters

NameDescription
CBCall site to predicate and clone.
CalleeValue compared against the call site's called operand.
BranchWeightsOptional !prof metadata for the new conditional branch.