LLVM 20.0.0git
|
An interface to query the internal state of an abstract attribute. More...
#include "llvm/Transforms/IPO/Attributor.h"
Public Member Functions | |
virtual | ~AbstractState ()=default |
virtual bool | isValidState () const =0 |
Return if this abstract state is in a valid state. | |
virtual bool | isAtFixpoint () const =0 |
Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself. | |
virtual ChangeStatus | indicateOptimisticFixpoint ()=0 |
Indicate that the abstract state should converge to the optimistic state. | |
virtual ChangeStatus | indicatePessimisticFixpoint ()=0 |
Indicate that the abstract state should converge to the pessimistic state. | |
An interface to query the internal state of an abstract attribute.
The abstract state is a minimal interface that allows the Attributor to communicate with the abstract attributes about their internal state without enforcing or exposing implementation details, e.g., the (existence of an) underlying lattice.
It is sufficient to be able to query if a state is (1) valid or invalid, (2) at a fixpoint, and to indicate to the state that (3) an optimistic fixpoint was reached or (4) a pessimistic fixpoint was enforced.
All methods need to be implemented by the subclass. For the common use case, a single boolean state or a bit-encoded state, the BooleanState and {Inc,Dec,Bit}IntegerState classes are already provided. An abstract attribute can inherit from them to get the abstract state interface and additional methods to directly modify the state based if needed. See the class comments for help.
Definition at line 2604 of file Attributor.h.
|
virtualdefault |
|
pure virtual |
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.
Implemented in llvm::IntegerStateBase< base_ty, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, 0 >, llvm::IntegerStateBase< uint32_t, BestState, 0 >, llvm::IntegerStateBase< uint16_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >, llvm::IntegerStateBase< bool, true, false >, llvm::IntegerStateBase< uint32_t, 0, ~uint32_t(0)>, llvm::IntegerRangeState, llvm::SetState< BaseTy >, llvm::SetState< StringRef >, llvm::ValueSimplifyStateType, llvm::PotentialValuesState< MemberTy >, llvm::DenormalFPMathState, and llvm::AA::PointerInfo::State.
|
pure virtual |
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.
Implemented in llvm::IntegerStateBase< base_ty, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, 0 >, llvm::IntegerStateBase< uint32_t, BestState, 0 >, llvm::IntegerStateBase< uint16_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >, llvm::IntegerStateBase< bool, true, false >, llvm::IntegerStateBase< uint32_t, 0, ~uint32_t(0)>, llvm::IntegerRangeState, llvm::SetState< BaseTy >, llvm::SetState< StringRef >, llvm::ValueSimplifyStateType, llvm::PotentialValuesState< MemberTy >, llvm::DenormalFPMathState, and llvm::AA::PointerInfo::State.
|
pure virtual |
Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself.
Implemented in llvm::IntegerStateBase< base_ty, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, 0 >, llvm::IntegerStateBase< uint32_t, BestState, 0 >, llvm::IntegerStateBase< uint16_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >, llvm::IntegerStateBase< bool, true, false >, llvm::IntegerStateBase< uint32_t, 0, ~uint32_t(0)>, llvm::IntegerRangeState, llvm::SetState< BaseTy >, llvm::SetState< StringRef >, llvm::ValueSimplifyStateType, llvm::PotentialValuesState< MemberTy >, llvm::DenormalFPMathState, and llvm::AA::PointerInfo::State.
Referenced by llvm::operator<<(), and llvm::Attributor::recordDependence().
|
pure virtual |
Return if this abstract state is in a valid state.
If false, no information provided should be used.
Implemented in llvm::IntegerStateBase< base_ty, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, WorstState >, llvm::IntegerStateBase< uint8_t, BestState, 0 >, llvm::IntegerStateBase< uint32_t, BestState, 0 >, llvm::IntegerStateBase< uint16_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, BestState, WorstState >, llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >, llvm::IntegerStateBase< bool, true, false >, llvm::IntegerStateBase< uint32_t, 0, ~uint32_t(0)>, llvm::IntegerRangeState, llvm::SetState< BaseTy >, llvm::SetState< StringRef >, llvm::ValueSimplifyStateType, llvm::PotentialValuesState< MemberTy >, llvm::DenormalFPMathState, and llvm::AA::PointerInfo::State.
Referenced by llvm::Attributor::getOrCreateAAFor(), llvm::Attributor::lookupAAFor(), and llvm::operator<<().