struct IntegerStateBase

Declaration

template <typename base_ty, base_ty BestState, base_ty WorstState>
struct IntegerStateBase : public AbstractState { /* full declaration omitted */ };

Description

Simple state with integers encoding. The interface ensures that the assumed bits are always a subset of the known bits. Users can only add known bits and, except through adding known bits, they can only remove assumed bits. This should guarantee monotoniticy and thereby the existence of a fixpoint (if used corretly). The fixpoint is reached when the assumed and known state/bits are equal. Users can force/inidicate a fixpoint. If an optimistic one is indicated, the known state will catch up with the assumed one, for a pessimistic fixpoint it is the other way around.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2287

Inherits from: AbstractState

Templates

base_ty
base_ty BestState
base_ty WorstState

Member Variables

protected llvm::IntegerStateBase::base_t Known = getWorstState()
The known state encoding in an integer of type base_t.
protected llvm::IntegerStateBase::base_t Assumed = getBestState()
The assumed state encoding in an integer of type base_t.

Method Overview

Inherited from AbstractState:

Methods

IntegerStateBase<base_ty, BestState, WorstState>()

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2290

IntegerStateBase<base_ty, BestState, WorstState>(
    llvm::IntegerStateBase::base_t Assumed)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2291

Parameters

llvm::IntegerStateBase::base_t Assumed

llvm::IntegerStateBase::base_t getAssumed() const

Description

Return the assumed state encoding.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2328

static constexpr llvm::IntegerStateBase::base_t
getBestState()

Description

Return the best possible representable state.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2294

static constexpr llvm::IntegerStateBase::base_t
getBestState(const IntegerStateBase<base_ty,
                                    BestState,
                                    WorstState>&)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2295

Parameters

const IntegerStateBase<base_ty, BestState, WorstState>&

llvm::IntegerStateBase::base_t getKnown() const

Description

Return the known state encoding

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2325

static constexpr llvm::IntegerStateBase::base_t
getWorstState()

Description

Return the worst possible representable state.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2300

static constexpr llvm::IntegerStateBase::base_t
getWorstState(const IntegerStateBase<base_ty,
                                     BestState,
                                     WorstState>&)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2301

Parameters

const IntegerStateBase<base_ty, BestState, WorstState>&

virtual void handleNewAssumedValue(
    llvm::IntegerStateBase::base_t Value)

Description

Handle a new assumed value \p Value. Subtype dependent.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2367

Parameters

llvm::IntegerStateBase::base_t Value

virtual void handleNewKnownValue(
    llvm::IntegerStateBase::base_t Value)

Description

Handle a new known value \p Value. Subtype dependent.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2370

Parameters

llvm::IntegerStateBase::base_t Value

llvm::ChangeStatus indicateOptimisticFixpoint()

Description

See AbstractState::indicateOptimisticFixpoint(...)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2313

llvm::ChangeStatus indicatePessimisticFixpoint()

Description

See AbstractState::indicatePessimisticFixpoint(...)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2319

bool isAtFixpoint() const

Description

See AbstractState::isAtFixpoint()

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2310

bool isValidState() const

Description

See AbstractState::isValidState() NOTE: For now we simply pretend that the worst possible state is invalid.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2307

virtual void joinAND(
    llvm::IntegerStateBase::base_t AssumedValue,
    llvm::IntegerStateBase::base_t KnownValue)

Description

Handle a new assumed value \p Value. Subtype dependent.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2376

Parameters

llvm::IntegerStateBase::base_t AssumedValue
llvm::IntegerStateBase::base_t KnownValue

virtual void joinOR(
    llvm::IntegerStateBase::base_t AssumedValue,
    llvm::IntegerStateBase::base_t KnownValue)

Description

Handle a value \p Value. Subtype dependent.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:2373

Parameters

llvm::IntegerStateBase::base_t AssumedValue
llvm::IntegerStateBase::base_t KnownValue