llvm::decomposeBitTestICmp

Decompose an icmp into the form ((X & Mask) pred C) if possible. Unless AllowNonZeroC is true, C will always be 0. If DecomposeAnd is specified, then, for equality predicates, this will decompose bitmasking via and.

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);

Return Value

Class template for optional values.

Parameters

NameDescription
LHSLLVM Value Representation
RHSLLVM Value Representation
PredThis enumeration lists the possible predicates for CmpInst subclasses. Values in the range 0-31 are reserved for FCmpInst, while values in the range 32-64 are reserved for ICmpInst. This is necessary to ensure the predicate values are not overlapping between the classes.