LLVM  17.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::AA::PointerInfo::State Struct Reference

A type to track pointer/struct usage and accesses for AAPointerInfo. More...

Inheritance diagram for llvm::AA::PointerInfo::State:
Inheritance graph
[legend]
Collaboration diagram for llvm::AA::PointerInfo::State:
Collaboration graph
[legend]

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 StategetAssumed () const
 
bool isValidState () const override
 See AbstractState::isValidState(). More...
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint(). More...
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(). More...
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(). More...
 
Stateoperator= (const State &R)
 
Stateoperator= (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. More...
 
const_bin_iterator begin () const
 
const_bin_iterator end () const
 
const AAPointerInfo::AccessgetAccess (unsigned Index) const
 
- Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()=default
 

Static Public Member Functions

static State getBestState (const State &SIS)
 Return the best possible representable state. More...
 
static State getWorstState (const State &SIS)
 Return the worst possible representable state. More...
 

Protected Member Functions

bool forallInterferingAccesses (AA::RangeTy Range, function_ref< bool(const AAPointerInfo::Access &, bool)> CB) const
 See AAPointerInfo::forallInterferingAccesses. More...
 
bool forallInterferingAccesses (Instruction &I, function_ref< bool(const AAPointerInfo::Access &, bool)> CB, AA::RangeTy &Range) const
 See AAPointerInfo::forallInterferingAccesses. More...
 

Protected Attributes

SmallVector< AAPointerInfo::AccessAccessList
 
OffsetBinsTy OffsetBins
 
DenseMap< const Instruction *, SmallVector< unsigned > > RemoteIMap
 

Detailed Description

A type to track pointer/struct usage and accesses for AAPointerInfo.

Definition at line 727 of file AttributorAttributes.cpp.

Member Typedef Documentation

◆ const_bin_iterator

Definition at line 796 of file AttributorAttributes.cpp.

◆ OffsetBinsTy

Definition at line 794 of file AttributorAttributes.cpp.

Constructor & Destructor Documentation

◆ State() [1/2]

llvm::AA::PointerInfo::State::State ( )
default

◆ State() [2/2]

llvm::AA::PointerInfo::State::State ( State &&  SIS)
default

Member Function Documentation

◆ addAccess()

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 870 of file AttributorAttributes.cpp.

References A, llvm::AA::PointerInfo::State::AccessList, assert(), llvm::Bin, Content, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dbgs(), llvm::AAPointerInfo::Access::getRanges(), I, Index, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), LLVM_DEBUG, llvm::AA::PointerInfo::State::OffsetBins, llvm::AA::PointerInfo::State::RemoteIMap, llvm::set_difference(), and ToRemove.

◆ begin()

const_bin_iterator llvm::AA::PointerInfo::State::begin ( ) const
inline

◆ end()

const_bin_iterator llvm::AA::PointerInfo::State::end ( ) const
inline

◆ forallInterferingAccesses() [1/2]

bool llvm::AA::PointerInfo::State::forallInterferingAccesses ( AA::RangeTy  Range,
function_ref< bool(const AAPointerInfo::Access &, bool)>  CB 
) const
inlineprotected

◆ forallInterferingAccesses() [2/2]

bool llvm::AA::PointerInfo::State::forallInterferingAccesses ( Instruction I,
function_ref< bool(const AAPointerInfo::Access &, bool)>  CB,
AA::RangeTy Range 
) const
inlineprotected

◆ getAccess()

const AAPointerInfo::Access& llvm::AA::PointerInfo::State::getAccess ( unsigned  Index) const
inline

Definition at line 800 of file AttributorAttributes.cpp.

References llvm::AA::PointerInfo::State::AccessList, and Index.

◆ getAssumed()

const State& llvm::AA::PointerInfo::State::getAssumed ( ) const
inline

Definition at line 741 of file AttributorAttributes.cpp.

◆ getBestState()

static State llvm::AA::PointerInfo::State::getBestState ( const State SIS)
inlinestatic

Return the best possible representable state.

Definition at line 729 of file AttributorAttributes.cpp.

References llvm::AA::PointerInfo::State::State().

◆ getWorstState()

static State llvm::AA::PointerInfo::State::getWorstState ( const State SIS)
inlinestatic

Return the worst possible representable state.

Definition at line 732 of file AttributorAttributes.cpp.

◆ indicateOptimisticFixpoint()

ChangeStatus llvm::AA::PointerInfo::State::indicateOptimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicateOptimisticFixpoint().

Implements llvm::AbstractState.

Definition at line 750 of file AttributorAttributes.cpp.

References llvm::UNCHANGED.

◆ indicatePessimisticFixpoint()

ChangeStatus llvm::AA::PointerInfo::State::indicatePessimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicatePessimisticFixpoint().

Implements llvm::AbstractState.

Definition at line 756 of file AttributorAttributes.cpp.

References llvm::CHANGED.

◆ isAtFixpoint()

bool llvm::AA::PointerInfo::State::isAtFixpoint ( ) const
inlineoverridevirtual

See AbstractState::isAtFixpoint().

Implements llvm::AbstractState.

Definition at line 747 of file AttributorAttributes.cpp.

◆ isValidState()

bool llvm::AA::PointerInfo::State::isValidState ( ) const
inlineoverridevirtual

See AbstractState::isValidState().

Implements llvm::AbstractState.

Definition at line 744 of file AttributorAttributes.cpp.

Referenced by llvm::AA::PointerInfo::State::forallInterferingAccesses().

◆ operator=() [1/2]

State& llvm::AA::PointerInfo::State::operator= ( const State R)
inline

◆ operator=() [2/2]

State& llvm::AA::PointerInfo::State::operator= ( State &&  R)
inline

Member Data Documentation

◆ AccessList

SmallVector<AAPointerInfo::Access> llvm::AA::PointerInfo::State::AccessList
protected

◆ OffsetBins

OffsetBinsTy llvm::AA::PointerInfo::State::OffsetBins
protected

◆ RemoteIMap

DenseMap<const Instruction *, SmallVector<unsigned> > llvm::AA::PointerInfo::State::RemoteIMap
protected

The documentation for this struct was generated from the following file: