struct KnownBits

Declaration

struct KnownBits { /* full declaration omitted */ };

Declared at: llvm/include/llvm/Support/KnownBits.h:22

Member Variables

public llvm::APInt Zero
public llvm::APInt One

Method Overview

Methods

KnownBits(unsigned int BitWidth)

Description

Create a known bits object of BitWidth bits initialized to unknown.

Declared at: llvm/include/llvm/Support/KnownBits.h:36

Parameters

unsigned int BitWidth

KnownBits()

Declared at: llvm/include/llvm/Support/KnownBits.h:33

static llvm::KnownBits computeForAddCarry(
    const llvm::KnownBits& LHS,
    const llvm::KnownBits& RHS,
    const llvm::KnownBits& Carry)

Description

Compute known bits resulting from adding LHS, RHS and a 1-bit Carry.

Declared at: llvm/include/llvm/Support/KnownBits.h:221

Parameters

const llvm::KnownBits& LHS
const llvm::KnownBits& RHS
const llvm::KnownBits& Carry

static llvm::KnownBits computeForAddSub(
    bool Add,
    bool NSW,
    const llvm::KnownBits& LHS,
    llvm::KnownBits RHS)

Description

Compute known bits resulting from adding LHS and RHS.

Declared at: llvm/include/llvm/Support/KnownBits.h:225

Parameters

bool Add
bool NSW
const llvm::KnownBits& LHS
llvm::KnownBits RHS

unsigned int countMaxLeadingOnes() const

Description

Returns the maximum number of leading one bits possible.

Declared at: llvm/include/llvm/Support/KnownBits.h:206

unsigned int countMaxLeadingZeros() const

Description

Returns the maximum number of leading zero bits possible.

Declared at: llvm/include/llvm/Support/KnownBits.h:201

unsigned int countMaxPopulation() const

Description

Returns the maximum number of bits that could be one.

Declared at: llvm/include/llvm/Support/KnownBits.h:216

unsigned int countMaxTrailingOnes() const

Description

Returns the maximum number of trailing one bits possible.

Declared at: llvm/include/llvm/Support/KnownBits.h:196

unsigned int countMaxTrailingZeros() const

Description

Returns the maximum number of trailing zero bits possible.

Declared at: llvm/include/llvm/Support/KnownBits.h:191

unsigned int countMinLeadingOnes() const

Description

Returns the minimum number of leading one bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:176

unsigned int countMinLeadingZeros() const

Description

Returns the minimum number of leading zero bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:171

unsigned int countMinPopulation() const

Description

Returns the number of bits known to be one.

Declared at: llvm/include/llvm/Support/KnownBits.h:211

unsigned int countMinSignBits() const

Description

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

Declared at: llvm/include/llvm/Support/KnownBits.h:182

unsigned int countMinTrailingOnes() const

Description

Returns the minimum number of trailing one bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:166

unsigned int countMinTrailingZeros() const

Description

Returns the minimum number of trailing zero bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:161

unsigned int getBitWidth() const

Description

Get the bit width of this value.

Declared at: llvm/include/llvm/Support/KnownBits.h:39

const llvm::APInt& getConstant() const

Description

Returns the value when all bits have a known value. This just returns One with a protective assertion.

Declared at: llvm/include/llvm/Support/KnownBits.h:56

llvm::APInt getMaxValue() const

Description

Return the maximal value possible given these KnownBits.

Declared at: llvm/include/llvm/Support/KnownBits.h:120

llvm::APInt getMinValue() const

Description

Return the minimal value possible given these KnownBits.

Declared at: llvm/include/llvm/Support/KnownBits.h:114

bool hasConflict() const

Description

Returns true if there is conflicting information.

Declared at: llvm/include/llvm/Support/KnownBits.h:46

bool isAllOnes() const

Description

Returns true if value is all one bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:77

bool isConstant() const

Description

Returns true if we know the value of all bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:49

bool isNegative() const

Description

Returns true if this value is known to be negative.

Declared at: llvm/include/llvm/Support/KnownBits.h:95

bool isNonNegative() const

Description

Returns true if this value is known to be non-negative.

Declared at: llvm/include/llvm/Support/KnownBits.h:98

bool isStrictlyPositive() const

Description

Returns true if this value is known to be positive.

Declared at: llvm/include/llvm/Support/KnownBits.h:101

bool isUnknown() const

Description

Returns true if we don't know any bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:62

bool isZero() const

Description

Returns true if value is all zero.

Declared at: llvm/include/llvm/Support/KnownBits.h:71

void makeNegative()

Description

Make this value negative.

Declared at: llvm/include/llvm/Support/KnownBits.h:104

void makeNonNegative()

Description

Make this value non-negative.

Declared at: llvm/include/llvm/Support/KnownBits.h:109

void resetAll()

Description

Resets the known state of all bits.

Declared at: llvm/include/llvm/Support/KnownBits.h:65

void setAllOnes()

Description

Make all bits known to be one and discard any previous information.

Declared at: llvm/include/llvm/Support/KnownBits.h:89

void setAllZero()

Description

Make all bits known to be zero and discard any previous information.

Declared at: llvm/include/llvm/Support/KnownBits.h:83

llvm::KnownBits sext(unsigned int BitWidth) const

Description

Sign extends the underlying known Zero and One bits. This is equivalent to sign extending the value we're tracking.

Declared at: llvm/include/llvm/Support/KnownBits.h:145

Parameters

unsigned int BitWidth

llvm::KnownBits trunc(unsigned int BitWidth) const

Description

Truncate the underlying known Zero and One bits. This is equivalent to truncating the value we're tracking.

Declared at: llvm/include/llvm/Support/KnownBits.h:127

Parameters

unsigned int BitWidth

llvm::KnownBits zext(
    unsigned int BitWidth,
    bool ExtendedBitsAreKnownZero) const

Description

Extends the underlying known Zero and One bits. By setting ExtendedBitsAreKnownZero=true this will be equivalent to zero extending the value we're tracking. With ExtendedBitsAreKnownZero=false the extended bits are set to unknown.

Declared at: llvm/include/llvm/Support/KnownBits.h:135

Parameters

unsigned int BitWidth
bool ExtendedBitsAreKnownZero

llvm::KnownBits zextOrTrunc(
    unsigned int BitWidth,
    bool ExtendedBitsAreKnownZero) const

Description

Extends or truncates the underlying known Zero and One bits. When extending the extended bits can either be set as known zero (if ExtendedBitsAreKnownZero=true) or as unknown (if ExtendedBitsAreKnownZero=false).

Declared at: llvm/include/llvm/Support/KnownBits.h:153

Parameters

unsigned int BitWidth
bool ExtendedBitsAreKnownZero