LLVM 22.0.0git
llvm::IntegerRangeState Struct Reference

State for an integer range. More...

#include "llvm/Transforms/IPO/Attributor.h"

Inheritance diagram for llvm::IntegerRangeState:
[legend]

Public Member Functions

 IntegerRangeState (uint32_t BitWidth)
 IntegerRangeState (const ConstantRange &CR)
uint32_t getBitWidth () const
 Return associated values' bit width.
bool isValidState () const override
 See AbstractState::isValidState()
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint()
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...)
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...)
ConstantRange getKnown () const
 Return the known state encoding.
ConstantRange getAssumed () const
 Return the assumed state encoding.
void unionAssumed (const ConstantRange &R)
 Unite assumed range with the passed state.
void unionAssumed (const IntegerRangeState &R)
 See IntegerRangeState::unionAssumed(..).
void intersectKnown (const ConstantRange &R)
 Intersect known range with the passed state.
void intersectKnown (const IntegerRangeState &R)
 See IntegerRangeState::intersectKnown(..).
bool operator== (const IntegerRangeState &R) const
 Equality for IntegerRangeState.
IntegerRangeState operator^= (const IntegerRangeState &R)
 "Clamp" this state with R.
IntegerRangeState operator&= (const IntegerRangeState &R)
Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()=default

Static Public Member Functions

static ConstantRange getWorstState (uint32_t BitWidth)
 Return the worst possible representable state.
static ConstantRange getBestState (uint32_t BitWidth)
 Return the best possible representable state.
static ConstantRange getBestState (const IntegerRangeState &IRS)

Public Attributes

uint32_t BitWidth
 Bitwidth of the associated value.
ConstantRange Assumed
 State representing assumed range, initially set to empty.
ConstantRange Known
 State representing known range, initially set to [-inf, inf].

Detailed Description

State for an integer range.

Definition at line 2968 of file Attributor.h.

Constructor & Destructor Documentation

◆ IntegerRangeState() [1/2]

llvm::IntegerRangeState::IntegerRangeState ( uint32_t BitWidth)
inline

Definition at line 2979 of file Attributor.h.

References Assumed, BitWidth, and Known.

Referenced by getBestState(), intersectKnown(), operator&=(), operator==(), operator^=(), and unionAssumed().

◆ IntegerRangeState() [2/2]

llvm::IntegerRangeState::IntegerRangeState ( const ConstantRange & CR)
inline

Definition at line 2983 of file Attributor.h.

References Assumed, BitWidth, getBitWidth(), getWorstState(), and Known.

Member Function Documentation

◆ getAssumed()

ConstantRange llvm::IntegerRangeState::getAssumed ( ) const
inline

Return the assumed state encoding.

Definition at line 3027 of file Attributor.h.

References Assumed.

Referenced by llvm::operator<<(), operator==(), and stripAndAccumulateOffsets().

◆ getBestState() [1/2]

ConstantRange llvm::IntegerRangeState::getBestState ( const IntegerRangeState & IRS)
inlinestatic

Definition at line 2996 of file Attributor.h.

References getBestState(), getBitWidth(), and IntegerRangeState().

◆ getBestState() [2/2]

ConstantRange llvm::IntegerRangeState::getBestState ( uint32_t BitWidth)
inlinestatic

Return the best possible representable state.

Definition at line 2993 of file Attributor.h.

References BitWidth.

Referenced by getBestState().

◆ getBitWidth()

uint32_t llvm::IntegerRangeState::getBitWidth ( ) const
inline

Return associated values' bit width.

Definition at line 3001 of file Attributor.h.

References BitWidth.

Referenced by getBestState(), IntegerRangeState(), and llvm::operator<<().

◆ getKnown()

ConstantRange llvm::IntegerRangeState::getKnown ( ) const
inline

Return the known state encoding.

Definition at line 3024 of file Attributor.h.

References Known.

Referenced by llvm::operator<<(), operator==(), and stripAndAccumulateOffsets().

◆ getWorstState()

ConstantRange llvm::IntegerRangeState::getWorstState ( uint32_t BitWidth)
inlinestatic

Return the worst possible representable state.

Definition at line 2988 of file Attributor.h.

References BitWidth.

Referenced by IntegerRangeState().

◆ indicateOptimisticFixpoint()

ChangeStatus llvm::IntegerRangeState::indicateOptimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicateOptimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 3012 of file Attributor.h.

References Assumed, llvm::CHANGED, and Known.

◆ indicatePessimisticFixpoint()

ChangeStatus llvm::IntegerRangeState::indicatePessimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicatePessimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 3018 of file Attributor.h.

References Assumed, llvm::CHANGED, and Known.

◆ intersectKnown() [1/2]

void llvm::IntegerRangeState::intersectKnown ( const ConstantRange & R)
inline

Intersect known range with the passed state.

Definition at line 3041 of file Attributor.h.

References Assumed, and Known.

Referenced by intersectKnown().

◆ intersectKnown() [2/2]

void llvm::IntegerRangeState::intersectKnown ( const IntegerRangeState & R)
inline

See IntegerRangeState::intersectKnown(..).

Definition at line 3047 of file Attributor.h.

References IntegerRangeState(), and intersectKnown().

◆ isAtFixpoint()

bool llvm::IntegerRangeState::isAtFixpoint ( ) const
inlineoverridevirtual

See AbstractState::isAtFixpoint()

Implements llvm::AbstractState.

Definition at line 3009 of file Attributor.h.

References Assumed, and Known.

◆ isValidState()

bool llvm::IntegerRangeState::isValidState ( ) const
inlineoverridevirtual

See AbstractState::isValidState()

Implements llvm::AbstractState.

Definition at line 3004 of file Attributor.h.

References Assumed, and BitWidth.

◆ operator&=()

IntegerRangeState llvm::IntegerRangeState::operator&= ( const IntegerRangeState & R)
inline

Definition at line 3066 of file Attributor.h.

References Assumed, IntegerRangeState(), and Known.

◆ operator==()

bool llvm::IntegerRangeState::operator== ( const IntegerRangeState & R) const
inline

Equality for IntegerRangeState.

Definition at line 3052 of file Attributor.h.

References getAssumed(), getKnown(), and IntegerRangeState().

◆ operator^=()

IntegerRangeState llvm::IntegerRangeState::operator^= ( const IntegerRangeState & R)
inline

"Clamp" this state with R.

The result is subtype dependent but it is intended that only information assumed in both states will be assumed in this one afterwards.

Definition at line 3059 of file Attributor.h.

References IntegerRangeState(), and unionAssumed().

◆ unionAssumed() [1/2]

void llvm::IntegerRangeState::unionAssumed ( const ConstantRange & R)
inline

Unite assumed range with the passed state.

Definition at line 3030 of file Attributor.h.

References Assumed, and Known.

Referenced by operator^=(), and unionAssumed().

◆ unionAssumed() [2/2]

void llvm::IntegerRangeState::unionAssumed ( const IntegerRangeState & R)
inline

See IntegerRangeState::unionAssumed(..).

Definition at line 3036 of file Attributor.h.

References IntegerRangeState(), and unionAssumed().

Member Data Documentation

◆ Assumed

ConstantRange llvm::IntegerRangeState::Assumed

◆ BitWidth

uint32_t llvm::IntegerRangeState::BitWidth

Bitwidth of the associated value.

Definition at line 2971 of file Attributor.h.

Referenced by getBestState(), getBitWidth(), getWorstState(), IntegerRangeState(), IntegerRangeState(), and isValidState().

◆ Known

ConstantRange llvm::IntegerRangeState::Known

State representing known range, initially set to [-inf, inf].

Definition at line 2977 of file Attributor.h.

Referenced by getKnown(), indicateOptimisticFixpoint(), indicatePessimisticFixpoint(), IntegerRangeState(), IntegerRangeState(), intersectKnown(), isAtFixpoint(), operator&=(), and unionAssumed().


The documentation for this struct was generated from the following file: