llvm::getBranchProbability

getBranchProbability overloads

Synopses

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

Return the edge probability from Src to successor Dst.

BranchProbability
getBranchProbability(
    BasicBlock* Src,
    BasicBlock* Dst);
» more...

Return the probability that conditional branch B takes one successor.

BranchProbability
getBranchProbability(
    CondBrInst* B,
    bool ForFirstTarget);
» more...

Return Value

  • The edge probability from Src to Dst, or unknown if unavailable.
  • The selected successor probability, or unknown if unsupported.

Parameters

NameDescription
SrcSource basic block of the CFG edge.
DstSuccessor basic block of the CFG edge.
BConditional branch with exactly two successors.
ForFirstTargetIf true, return the probability of the first successor; otherwise the second.