Extract branch weights from a conditional branch or select Instruction.

Synopsis

Declared in <llvm/IR/ProfDataUtils.h>

bool
extractBranchWeights(
    Instruction const& I,
    uint64_t& TrueVal,
    uint64_t& FalseVal);

Return Value

True on success with profile weights filled in. False if no metadata or invalid metadata was found.

Parameters

Name

Description

I

The instruction to extract branch weights from.

TrueVal [out]

will contain the branch weight for the True branch

FalseVal [out]

will contain the branch weight for the False branch

Created with MrDocs