llvm::parseWidenableBranch

Parses a widenable branch and returns its condition, widenable condition, and successor blocks.

Synopsis

Declared in <llvm/Analysis/GuardUtils.h>

bool
parseWidenableBranch(
    User const* U,
    Value*& Condition,
    Value*& WidenableCondition,
    BasicBlock*& IfTrueBB,
    BasicBlock*& IfFalseBB);

Description

If U is widenable branch looking like: %cond = ... %wc = call i1 llvm.experimental.widenable.condition() %branch_cond = and i1 %cond, %wc br i1 %branch_cond, label %if_true_bb, label %if_false_bb ; <--- U The function returns true, and the values %cond and %wc and blocks %if_true_bb, if_false_bb are returned in the parameters (Condition, WidenableCondition, IfTrueBB and IfFalseBB) respectively. If U does not match this pattern, return false.

Return Value

True if U matches the widenable branch pattern.

Parameters

NameDescription
UUser expected to be the widenable branch.
ConditionSet to the non-widenable part of the branch condition.
WidenableConditionSet to the widenable.condition call result.
IfTrueBBSet to the true successor of the branch.
IfFalseBBSet to the false successor of the branch.