llvm::setExplicitlyUnknownBranchWeights

Specify that this terminator's branch weights are unknown at compile time.

Synopsis

Declared in <llvm/IR/ProfDataUtils.h>

void
setExplicitlyUnknownBranchWeights(
    Instruction& I,
    StringRef PassName);

Description

This should only be called by passes, and never as a default behavior in e.g. MDBuilder. The goal is to use this info to validate passes do not accidentally drop profile info, and this API is called in cases where the pass explicitly cannot provide that info. Defaulting it in would hide bugs where the pass forgets to transfer over or otherwise specify profile info. Use PassName to capture the pass name (i.e. DEBUG_TYPE) for debuggability.

Parameters

NameDescription
IThe terminator instruction to mark.
PassNameThe pass name (typically DEBUG_TYPE) recorded for debugging.