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
Collaboration diagram for llvm::AA::PointerInfo::State:
Collaboration graph

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 ( )

◆ State() [2/2]

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

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

◆ end()

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

◆ forallInterferingAccesses() [1/2]

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

◆ forallInterferingAccesses() [2/2]

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

◆ getAccess()

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

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

Definition at line 741 of file AttributorAttributes.cpp.

◆ getBestState()

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

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)

Return the worst possible representable state.

Definition at line 732 of file AttributorAttributes.cpp.

◆ indicateOptimisticFixpoint()

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

See AbstractState::indicateOptimisticFixpoint().

Implements llvm::AbstractState.

Definition at line 750 of file AttributorAttributes.cpp.

References llvm::UNCHANGED.

◆ indicatePessimisticFixpoint()

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

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

See AbstractState::isAtFixpoint().

Implements llvm::AbstractState.

Definition at line 747 of file AttributorAttributes.cpp.

◆ isValidState()

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

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)

◆ operator=() [2/2]

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

Member Data Documentation

◆ AccessList

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

◆ OffsetBins

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

◆ RemoteIMap

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

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