Decompose an icmp into the form ((X & Mask) pred C) if possible.

Synopsis

Declared in <llvm/Analysis/CmpInstAnalysis.h>

std::optional<DecomposedBitTest>
decomposeBitTestICmp(
    Value* LHS,
    Value* RHS,
    CmpInst::Predicate Pred,
    bool LookThroughTrunc = true,
    bool AllowNonZeroC = false,
    bool DecomposeAnd = false);

Description

Unless AllowNonZeroC is true, C will always be 0. If DecomposeAnd is specified, then, for equality predicates, this will decompose bitmasking via and.

Return Value

Decomposed bit‐test form when possible; otherwise std::nullopt.

Parameters

Name

Description

LHS

Left‐hand operand of the icmp.

RHS

Right‐hand operand of the icmp.

Pred

Predicate of the icmp to decompose.

LookThroughTrunc

When true, look through truncates on the operands.

AllowNonZeroC

When true, allow a non‐zero constant C.

DecomposeAnd

When true, decompose equality bitmasking via and.

Created with MrDocs