llvm::isKnownToBeAPowerOfTwo

Return true if V is known to be a power of two when defined.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

bool
isKnownToBeAPowerOfTwo(
    Value const* V,
    bool OrZero,
    SimplifyQuery const& Q,
    unsigned int Depth = 0);

Return Value

True if V is a power of two when defined (or zero if OrZero).

Parameters

NameDescription
VValue to test for being a power of two.
OrZeroAlso accept zero as a successful result.
QSimplify query providing context for the analysis.
DepthCurrent recursion depth for this query.