llvm::extractBranchWeights

Extract branch weights from MD_prof metadata

Synopsis

Declared in <llvm/IR/ProfDataUtils.h>

bool
extractBranchWeights(
    MDNode const* ProfileData,
    SmallVectorImpl<uint32_t>& Weights);

Return Value

True if weights were extracted, False otherwise. When false Weights will be cleared.

Parameters

NameDescription
ProfileDataA pointer to an MDNode.
Weights [out]An output vector to fill with branch weights