|
LLVM 24.0.0git
|
Simple state with integers encoding. More...
#include "llvm/Transforms/IPO/Attributor.h"
Public Types | |
| using | base_t = base_ty |
Public Member Functions | |
| IntegerStateBase ()=default | |
| IntegerStateBase (base_t Assumed) | |
| bool | isValidState () const override |
| NOTE: For now we simply pretend that the worst possible state is invalid. | |
| bool | isAtFixpoint () const override |
| Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself. | |
| ChangeStatus | indicateOptimisticFixpoint () override |
| Indicate that the abstract state should converge to the optimistic state. | |
| ChangeStatus | indicatePessimisticFixpoint () override |
| Indicate that the abstract state should converge to the pessimistic state. | |
| base_t | getKnown () const |
| Return the known state encoding. | |
| base_t | getAssumed () const |
| Return the assumed state encoding. | |
| bool | operator== (const IntegerStateBase< base_t, BestState, WorstState > &R) const |
| Equality for IntegerStateBase. | |
| bool | operator!= (const IntegerStateBase< base_t, BestState, WorstState > &R) const |
| Inequality for IntegerStateBase. | |
| void | operator^= (const IntegerStateBase< base_t, BestState, WorstState > &R) |
"Clamp" this state with R. | |
| void | operator+= (const IntegerStateBase< base_t, BestState, WorstState > &R) |
"Clamp" this state with R. | |
| void | operator|= (const IntegerStateBase< base_t, BestState, WorstState > &R) |
| void | operator&= (const IntegerStateBase< base_t, BestState, WorstState > &R) |
| Public Member Functions inherited from llvm::AbstractState | |
| virtual | ~AbstractState ()=default |
Static Public Member Functions | |
| static constexpr base_t | getBestState () |
| Return the best possible representable state. | |
| static constexpr base_t | getBestState (const IntegerStateBase &) |
| static constexpr base_t | getWorstState () |
| Return the worst possible representable state. | |
| static constexpr base_t | getWorstState (const IntegerStateBase &) |
Protected Member Functions | |
| virtual void | handleNewAssumedValue (base_t Value)=0 |
Handle a new assumed value Value. Subtype dependent. | |
| virtual void | handleNewKnownValue (base_t Value)=0 |
Handle a new known value Value. Subtype dependent. | |
| virtual void | joinOR (base_t AssumedValue, base_t KnownValue)=0 |
Handle a value Value. Subtype dependent. | |
| virtual void | joinAND (base_t AssumedValue, base_t KnownValue)=0 |
Handle a new assumed value Value. Subtype dependent. | |
Protected Attributes | |
| base_t | Known = getWorstState() |
| The known state encoding in an integer of type base_t. | |
| base_t | Assumed = getBestState() |
| The assumed state encoding in an integer of type base_t. | |
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 monotonicity and thereby the existence of a fixpoint (if used correctly). 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.
Definition at line 2641 of file Attributor.h.
| using llvm::IntegerStateBase< base_ty, BestState, WorstState >::base_t = base_ty |
Definition at line 2642 of file Attributor.h.
|
default |
|
inline |
Definition at line 2645 of file Attributor.h.
|
inline |
Return the assumed state encoding.
Definition at line 2678 of file Attributor.h.
Referenced by llvm::AAAlign::getAssumedAlign(), llvm::AADereferenceable::isAssumedGlobal(), llvm::operator<<(), and llvm::IntegerStateBase< bool, true, false >::operator==().
|
inlinestaticconstexpr |
Return the best possible representable state.
Definition at line 2648 of file Attributor.h.
Referenced by llvm::IntegerStateBase< bool, true, false >::getBestState().
|
inlinestaticconstexpr |
Definition at line 2649 of file Attributor.h.
|
inline |
Return the known state encoding.
Definition at line 2675 of file Attributor.h.
Referenced by llvm::AAAlign::getKnownAlign(), llvm::AADereferenceable::isKnownGlobal(), llvm::operator<<(), and llvm::IntegerStateBase< bool, true, false >::operator==().
|
inlinestaticconstexpr |
Return the worst possible representable state.
Definition at line 2654 of file Attributor.h.
Referenced by llvm::IntegerStateBase< bool, true, false >::getWorstState(), and llvm::IntegerStateBase< bool, true, false >::isValidState().
|
inlinestaticconstexpr |
Definition at line 2655 of file Attributor.h.
|
protectedpure virtual |
Handle a new assumed value Value. Subtype dependent.
Referenced by llvm::IntegerStateBase< bool, true, false >::operator^=().
|
protectedpure virtual |
Handle a new known value Value. Subtype dependent.
Referenced by llvm::IntegerStateBase< bool, true, false >::operator+=().
|
inlineoverridevirtual |
Indicate that the abstract state should converge to the optimistic state.
This will usually make the optimistically assumed state the known to be true state.
Implements llvm::AbstractState.
Definition at line 2664 of file Attributor.h.
|
inlineoverridevirtual |
Indicate that the abstract state should converge to the pessimistic state.
This will usually revert the optimistically assumed state to the known to be true state.
Implements llvm::AbstractState.
Definition at line 2669 of file Attributor.h.
|
inlineoverridevirtual |
Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself.
Implements llvm::AbstractState.
Definition at line 2662 of file Attributor.h.
|
inlineoverridevirtual |
NOTE: For now we simply pretend that the worst possible state is invalid.
Implements llvm::AbstractState.
Definition at line 2660 of file Attributor.h.
|
protectedpure virtual |
Handle a new assumed value Value. Subtype dependent.
Referenced by llvm::IntegerStateBase< bool, true, false >::operator&=().
|
protectedpure virtual |
Handle a value Value. Subtype dependent.
Referenced by llvm::IntegerStateBase< bool, true, false >::operator|=().
|
inline |
Inequality for IntegerStateBase.
Definition at line 2689 of file Attributor.h.
|
inline |
Definition at line 2711 of file Attributor.h.
|
inline |
"Clamp" this state with R.
The result is subtype dependent but it is intended that information known in either state will be known in this one afterwards.
Definition at line 2703 of file Attributor.h.
|
inline |
Equality for IntegerStateBase.
Definition at line 2682 of file Attributor.h.
|
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 2696 of file Attributor.h.
|
inline |
Definition at line 2707 of file Attributor.h.
|
protected |
The assumed state encoding in an integer of type base_t.
Definition at line 2732 of file Attributor.h.
Referenced by llvm::IncIntegerState< uint64_t, Value::MaximumAlignment, 1 >::IncIntegerState(), llvm::IncIntegerState< uint64_t, Value::MaximumAlignment, 1 >::takeAssumedMinimum(), and llvm::IncIntegerState< uint64_t, Value::MaximumAlignment, 1 >::takeKnownMaximum().
|
protected |
The known state encoding in an integer of type base_t.
Definition at line 2729 of file Attributor.h.
Referenced by llvm::IncIntegerState< uint64_t, Value::MaximumAlignment, 1 >::takeAssumedMinimum(), and llvm::IncIntegerState< uint64_t, Value::MaximumAlignment, 1 >::takeKnownMaximum().