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:1255
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
- public llvm::IntegerStateBase::base_t getAssumed() const
- public static constexpr llvm::IntegerStateBase::base_t getBestState()
- public llvm::IntegerStateBase::base_t getKnown() const
- public static constexpr llvm::IntegerStateBase::base_t getWorstState()
- protected virtual void handleNewAssumedValue(llvm::IntegerStateBase::base_t Value)
- protected virtual void handleNewKnownValue(llvm::IntegerStateBase::base_t Value)
- public llvm::ChangeStatus indicateOptimisticFixpoint()
- public llvm::ChangeStatus indicatePessimisticFixpoint()
- public bool isAtFixpoint() const
- public bool isValidState() const
- protected virtual void joinAND(llvm::IntegerStateBase::base_t AssumedValue, llvm::IntegerStateBase::base_t KnownValue)
- protected virtual void joinOR(llvm::IntegerStateBase::base_t AssumedValue, llvm::IntegerStateBase::base_t KnownValue)
Inherited from AbstractState:
- public indicateOptimisticFixpoint
- public indicatePessimisticFixpoint
- public isAtFixpoint
- public isValidState
Methods
¶llvm::IntegerStateBase::base_t getAssumed() const
llvm::IntegerStateBase::base_t getAssumed() const
Description
Return the assumed state encoding.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1287
¶static constexpr llvm::IntegerStateBase::base_t
getBestState()
static constexpr llvm::IntegerStateBase::base_t
getBestState()
Description
Return the best possible representable state.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1259
¶llvm::IntegerStateBase::base_t getKnown() const
llvm::IntegerStateBase::base_t getKnown() const
Description
Return the known state encoding
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1284
¶static constexpr llvm::IntegerStateBase::base_t
getWorstState()
static constexpr llvm::IntegerStateBase::base_t
getWorstState()
Description
Return the worst possible representable state.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1262
¶virtual void handleNewAssumedValue(
llvm::IntegerStateBase::base_t Value)
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:1319
Parameters
- llvm::IntegerStateBase::base_t Value
¶virtual void handleNewKnownValue(
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:1322
Parameters
- llvm::IntegerStateBase::base_t Value
¶llvm::ChangeStatus indicateOptimisticFixpoint()
llvm::ChangeStatus indicateOptimisticFixpoint()
Description
See AbstractState::indicateOptimisticFixpoint(...)
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1272
¶llvm::ChangeStatus indicatePessimisticFixpoint()
llvm::ChangeStatus indicatePessimisticFixpoint()
Description
See AbstractState::indicatePessimisticFixpoint(...)
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1278
¶bool isAtFixpoint() const
bool isAtFixpoint() const
Description
See AbstractState::isAtFixpoint()
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1269
¶bool isValidState() const
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:1266
¶virtual void joinAND(
llvm::IntegerStateBase::base_t AssumedValue,
llvm::IntegerStateBase::base_t KnownValue)
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:1328
Parameters
- llvm::IntegerStateBase::base_t AssumedValue
- llvm::IntegerStateBase::base_t KnownValue
¶virtual void joinOR(
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:1325
Parameters
- llvm::IntegerStateBase::base_t AssumedValue
- llvm::IntegerStateBase::base_t KnownValue