llvm::getDisjunctionWeights

Get the branch weights of a branch conditioned on b1 || b2.

Synopsis

Declared in <llvm/IR/ProfDataUtils.h>

template<
    typename T1,
    typename T2,
    typename = std::enable_if<std::is_arithmetic_v<T1> && std::is_arithmetic_v<T2> && sizeof(T1) <= sizeof(uint64_t) && sizeof(T2) <= sizeof(uint64_t)>>
SmallVector<uint64_t, 2>
getDisjunctionWeights(
    SmallVector<T1, 2> const& B1,
    SmallVector<T2, 2> const& B2);

Description

b1 and b2 are 2 booleans that are the conditions of 2 branches for which we have the branch weights B1 and B2, respectively. In both B1 and B2, the first position (index 0) is for the 'true' branch, and the second position (index 1) is for the 'false' branch.

Return Value

Branch weights for the disjunction, [true, false].

Parameters

NameDescription
B1Branch weights of the first condition, [true, false].
B2Branch weights of the second condition, [true, false].