llvm::isKnownNonZero

Return true if the given value is known to be non-zero when defined.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

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

Description

For vectors, return true if every element is known to be non-zero when defined. For pointers, if the context instruction and dominator tree are specified, perform context-sensitive analysis and return true if the pointer couldn't possibly be null at the specified instruction. Supports values with integer or pointer type and vectors of integers.

Return Value

True if V is known non-zero when defined.

Parameters

NameDescription
VValue to test for being non-zero.
QSimplify query providing context for the analysis.
DepthCurrent recursion depth for this query.