llvm::ComputeMaxSignificantBits

Get the upper bound on bit size for this Value Op as a signed integer.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

unsigned int
ComputeMaxSignificantBits(
    Value const* Op,
    DataLayout const& DL,
    AssumptionCache* AC = nullptr,
    Instruction const* CxtI = nullptr,
    DominatorTree const* DT = nullptr,
    unsigned int Depth = 0);

Description

i.e. x == sext(trunc(x to MaxSignificantBits) to bitwidth(x)). Similar to the APInt::getSignificantBits function.

Return Value

Upper bound on significant bits needed to represent Op.

Parameters

NameDescription
OpValue whose maximum significant bit width is computed.
DLData layout used for type sizes and pointer widths.
ACOptional assumption cache for context-sensitive facts.
CxtIOptional context instruction for local analysis.
DTOptional dominator tree for context-sensitive analysis.
DepthCurrent recursion depth for this query.