LLVM 18.0.0git
|
A type to track pointer/struct usage and accesses for AAPointerInfo. More...
Public Types | |
using | OffsetBinsTy = DenseMap< RangeTy, SmallSet< unsigned, 4 > > |
using | const_bin_iterator = OffsetBinsTy::const_iterator |
Public Member Functions | |
State ()=default | |
State (State &&SIS)=default | |
const State & | getAssumed () const |
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(). | |
State & | operator= (const State &R) |
State & | operator= (State &&R) |
ChangeStatus | addAccess (Attributor &A, const AAPointerInfo::RangeList &Ranges, Instruction &I, std::optional< Value * > Content, AAPointerInfo::AccessKind Kind, Type *Ty, Instruction *RemoteI=nullptr) |
Add a new Access to the state at offset Offset and with size Size . | |
const_bin_iterator | begin () const |
const_bin_iterator | end () const |
const AAPointerInfo::Access & | getAccess (unsigned Index) const |
![]() | |
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. | |
Static Public Member Functions | |
static State | getBestState (const State &SIS) |
Return the best possible representable state. | |
static State | getWorstState (const State &SIS) |
Return the worst possible representable state. | |
Protected Member Functions | |
bool | forallInterferingAccesses (AA::RangeTy Range, function_ref< bool(const AAPointerInfo::Access &, bool)> CB) const |
See AAPointerInfo::forallInterferingAccesses. | |
bool | forallInterferingAccesses (Instruction &I, function_ref< bool(const AAPointerInfo::Access &, bool)> CB, AA::RangeTy &Range) const |
See AAPointerInfo::forallInterferingAccesses. | |
Protected Attributes | |
SmallVector< AAPointerInfo::Access > | AccessList |
OffsetBinsTy | OffsetBins |
DenseMap< const Instruction *, SmallVector< unsigned > > | RemoteIMap |
A type to track pointer/struct usage and accesses for AAPointerInfo.
Definition at line 817 of file AttributorAttributes.cpp.
Definition at line 886 of file AttributorAttributes.cpp.
using llvm::AA::PointerInfo::State::OffsetBinsTy = DenseMap<RangeTy, SmallSet<unsigned, 4> > |
Definition at line 884 of file AttributorAttributes.cpp.
|
default |
Referenced by llvm::AA::PointerInfo::State::getBestState().
|
default |
ChangeStatus llvm::AA::PointerInfo::State::addAccess | ( | Attributor & | A, |
const AAPointerInfo::RangeList & | Ranges, | ||
Instruction & | I, | ||
std::optional< Value * > | Content, | ||
AAPointerInfo::AccessKind | Kind, | ||
Type * | Ty, | ||
Instruction * | RemoteI = nullptr |
||
) |
Add a new Access to the state at offset Offset
and with size Size
.
The access is associated with I
, writes Content
(if anything), and is of kind Kind
. If an Access already exists for the same I
and same RemoteI
, the two are combined, potentially losing information about offset and size. The resulting access must now be moved from its original OffsetBin to the bin for its new offset.
\Returns CHANGED, if the state changed, UNCHANGED otherwise.
Definition at line 960 of file AttributorAttributes.cpp.
References A, llvm::AA::PointerInfo::State::AccessList, assert(), llvm::Bin, llvm::CHANGED, Content, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dbgs(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), LLVM_DEBUG, llvm::AA::PointerInfo::State::OffsetBins, llvm::AA::PointerInfo::State::RemoteIMap, llvm::AAPointerInfo::RangeList::set_difference(), ToRemove, and llvm::UNCHANGED.
|
inline |
Definition at line 887 of file AttributorAttributes.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::begin(), and llvm::AA::PointerInfo::State::OffsetBins.
|
inline |
Definition at line 888 of file AttributorAttributes.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::AA::PointerInfo::State::OffsetBins.
|
inlineprotected |
See AAPointerInfo::forallInterferingAccesses.
Definition at line 912 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::AccessList, llvm::AA::PointerInfo::State::isValidState(), and llvm::AA::PointerInfo::State::OffsetBins.
Referenced by llvm::AA::PointerInfo::State::forallInterferingAccesses().
|
inlineprotected |
See AAPointerInfo::forallInterferingAccesses.
Definition at line 933 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::AccessList, llvm::AA::PointerInfo::State::forallInterferingAccesses(), I, llvm::AA::PointerInfo::State::isValidState(), and llvm::AA::PointerInfo::State::RemoteIMap.
|
inline |
Definition at line 890 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::AccessList.
Definition at line 831 of file AttributorAttributes.cpp.
Return the best possible representable state.
Definition at line 819 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::State().
Return the worst possible representable state.
Definition at line 822 of file AttributorAttributes.cpp.
|
inlineoverridevirtual |
See AbstractState::indicateOptimisticFixpoint().
Implements llvm::AbstractState.
Definition at line 840 of file AttributorAttributes.cpp.
References llvm::IntegerStateBase< base_ty, BestState, WorstState >::indicateOptimisticFixpoint(), and llvm::UNCHANGED.
|
inlineoverridevirtual |
See AbstractState::indicatePessimisticFixpoint().
Implements llvm::AbstractState.
Definition at line 846 of file AttributorAttributes.cpp.
References llvm::CHANGED, and llvm::IntegerStateBase< base_ty, BestState, WorstState >::indicatePessimisticFixpoint().
|
inlineoverridevirtual |
See AbstractState::isAtFixpoint().
Implements llvm::AbstractState.
Definition at line 837 of file AttributorAttributes.cpp.
References llvm::IntegerStateBase< base_ty, BestState, WorstState >::isAtFixpoint().
|
inlineoverridevirtual |
See AbstractState::isValidState().
Implements llvm::AbstractState.
Definition at line 834 of file AttributorAttributes.cpp.
References llvm::IntegerStateBase< base_ty, BestState, WorstState >::isValidState().
Referenced by llvm::AA::PointerInfo::State::forallInterferingAccesses().
Definition at line 851 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::AccessList, llvm::AA::PointerInfo::State::OffsetBins, and llvm::AA::PointerInfo::State::RemoteIMap.
Definition at line 861 of file AttributorAttributes.cpp.
References llvm::AA::PointerInfo::State::AccessList, llvm::AA::PointerInfo::State::OffsetBins, llvm::AA::PointerInfo::State::RemoteIMap, and std::swap().
|
protected |
Definition at line 907 of file AttributorAttributes.cpp.
Referenced by llvm::AA::PointerInfo::State::addAccess(), llvm::AA::PointerInfo::State::forallInterferingAccesses(), llvm::AA::PointerInfo::State::getAccess(), and llvm::AA::PointerInfo::State::operator=().
|
protected |
|
protected |
Definition at line 909 of file AttributorAttributes.cpp.
Referenced by llvm::AA::PointerInfo::State::addAccess(), llvm::AA::PointerInfo::State::forallInterferingAccesses(), and llvm::AA::PointerInfo::State::operator=().