Return the number of times the sign bit of the register is replicated into the other bits.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

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

Description

We know that at least 1 bit is always equal to the sign bit (itself), but other cases can give us information. For example, immediately after an "ashr X, 2", we know that the top 3 bits are all equal to each other, so we return 3. For vectors, return the number of sign bits for the vector element with the mininum number of known sign bits.

Return Value

Number of known replicated sign bits, including the sign bit itself.

Parameters

Name

Description

Op

Value whose leading sign bits are counted.

DL

Data layout used for type sizes and pointer widths.

AC

Optional assumption cache for context‐sensitive facts.

CxtI

Optional context instruction for local analysis.

DT

Optional dominator tree for context‐sensitive analysis.

UseInstrInfo

Whether to use instruction‐level information.

Depth

Current recursion depth for this query.

Created with MrDocs