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

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

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

Classes

struct  Accesses
 We store accesses in a set with the instruction as key. More...
 

Public Types

using AccessBinsTy = DenseMap< AAPointerInfo::OffsetAndSize, Accesses * >
 We store all accesses in bins denoted by their offset and size. More...
 

Public Member Functions

 ~State ()
 
 State ()=default
 
 State (State &&SIS)
 
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)
 
bool operator== (const State &R) const
 
bool operator!= (const State &R) const
 
AccessBinsTy::const_iterator begin () const
 
AccessBinsTy::const_iterator end () 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

ChangeStatus addAccess (Attributor &A, int64_t Offset, int64_t Size, Instruction &I, Optional< Value * > Content, AAPointerInfo::AccessKind Kind, Type *Ty, Instruction *RemoteI=nullptr, Accesses *BinPtr=nullptr)
 Add a new access to the state at offset Offset and with size Size. More...
 
bool forallInterferingAccesses (AAPointerInfo::OffsetAndSize OAS, 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) const
 See AAPointerInfo::forallInterferingAccesses. More...
 

Protected Attributes

AccessBinsTy AccessBins
 The bins with all the accesses for the associated pointer. More...
 

Detailed Description

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

Definition at line 881 of file AttributorAttributes.cpp.

Member Typedef Documentation

◆ AccessBinsTy

We store all accesses in bins denoted by their offset and size.

Definition at line 991 of file AttributorAttributes.cpp.

Constructor & Destructor Documentation

◆ ~State()

AA::PointerInfo::State::~State ( )
inline

Definition at line 883 of file AttributorAttributes.cpp.

References AccessBins.

◆ State() [1/2]

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

Referenced by getBestState().

◆ State() [2/2]

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

Member Function Documentation

◆ addAccess()

ChangeStatus AA::PointerInfo::State::addAccess ( Attributor A,
int64_t  Offset,
int64_t  Size,
Instruction I,
Optional< Value * >  Content,
AAPointerInfo::AccessKind  Kind,
Type Ty,
Instruction RemoteI = nullptr,
Accesses BinPtr = nullptr 
)
inlineprotected

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. \Returns CHANGED, if the state changed, UNCHANGED otherwise.

Definition at line 1004 of file AttributorAttributes.cpp.

References AccessBins, llvm::Bin, Content, and I.

◆ begin()

AccessBinsTy::const_iterator AA::PointerInfo::State::begin ( ) const
inline

◆ end()

AccessBinsTy::const_iterator AA::PointerInfo::State::end ( ) const
inline

◆ forallInterferingAccesses() [1/2]

bool AA::PointerInfo::State::forallInterferingAccesses ( AAPointerInfo::OffsetAndSize  OAS,
function_ref< bool(const AAPointerInfo::Access &, bool)>  CB 
) const
inlineprotected

◆ forallInterferingAccesses() [2/2]

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

See AAPointerInfo::forallInterferingAccesses.

Definition at line 1049 of file AttributorAttributes.cpp.

References AccessBins, forallInterferingAccesses(), llvm::AAPointerInfo::OffsetAndSize::getSize(), I, and isValidState().

◆ getAssumed()

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

Definition at line 904 of file AttributorAttributes.cpp.

◆ getBestState()

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

Return the best possible representable state.

Definition at line 890 of file AttributorAttributes.cpp.

References State().

◆ getWorstState()

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

Return the worst possible representable state.

Definition at line 893 of file AttributorAttributes.cpp.

◆ indicateOptimisticFixpoint()

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

See AbstractState::indicateOptimisticFixpoint().

Implements llvm::AbstractState.

Definition at line 913 of file AttributorAttributes.cpp.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::indicateOptimisticFixpoint().

◆ indicatePessimisticFixpoint()

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

See AbstractState::indicatePessimisticFixpoint().

Implements llvm::AbstractState.

Definition at line 919 of file AttributorAttributes.cpp.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::indicatePessimisticFixpoint().

◆ isAtFixpoint()

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

See AbstractState::isAtFixpoint().

Implements llvm::AbstractState.

Definition at line 910 of file AttributorAttributes.cpp.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::isAtFixpoint().

◆ isValidState()

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

See AbstractState::isValidState().

Implements llvm::AbstractState.

Definition at line 907 of file AttributorAttributes.cpp.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::isValidState().

Referenced by forallInterferingAccesses().

◆ operator!=()

bool AA::PointerInfo::State::operator!= ( const State R) const
inline

Definition at line 961 of file AttributorAttributes.cpp.

◆ operator=() [1/2]

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

Definition at line 924 of file AttributorAttributes.cpp.

References AccessBins.

◆ operator=() [2/2]

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

Definition at line 932 of file AttributorAttributes.cpp.

References AccessBins, and std::swap().

◆ operator==()

bool AA::PointerInfo::State::operator== ( const State R) const
inline

Member Data Documentation

◆ AccessBins

AccessBinsTy AA::PointerInfo::State::AccessBins
protected

The bins with all the accesses for the associated pointer.

Definition at line 998 of file AttributorAttributes.cpp.

Referenced by addAccess(), begin(), end(), forallInterferingAccesses(), operator=(), operator==(), and ~State().


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