LLVM 22.0.0git
llvm::PotentialValuesState< MemberTy > Struct Template Reference

A class for a set state. More...

#include "llvm/Transforms/IPO/Attributor.h"

Inheritance diagram for llvm::PotentialValuesState< MemberTy >:
[legend]

Public Types

using SetTy = SmallSetVector<MemberTy, 8>

Public Member Functions

 PotentialValuesState ()
 PotentialValuesState (bool IsValid)
bool isValidState () const override
 See AbstractState::isValidState(...)
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint(...)
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...)
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...)
PotentialValuesStategetAssumed ()
 Return the assumed state.
const PotentialValuesStategetAssumed () const
const SetTygetAssumedSet () const
 Return this set.
bool undefIsContained () const
 Returns whether this state contains an undef value or not.
bool operator== (const PotentialValuesState &RHS) const
void unionAssumed (const MemberTy &C)
 Union assumed set with the passed value.
void unionAssumed (const PotentialValuesState &PVS)
 Union assumed set with assumed set of the passed state PVS.
void unionAssumedWithUndef ()
 Union assumed set with an undef value.
PotentialValuesState operator^= (const PotentialValuesState &PVS)
 "Clamp" this state with PVS.
PotentialValuesState operator&= (const PotentialValuesState &PVS)
bool contains (const MemberTy &V) const
Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()=default

Static Public Member Functions

static PotentialValuesState getBestState ()
 Return empty set as the best state of potential values.
static PotentialValuesState getBestState (const PotentialValuesState &PVS)
static PotentialValuesState getWorstState ()
 Return full set as the worst state of potential values.

Static Public Attributes

static unsigned MaxPotentialValues
 Maximum number of potential values to be tracked.

Protected Member Functions

SetTygetAssumedSet ()

Detailed Description

template<typename MemberTy>
struct llvm::PotentialValuesState< MemberTy >

A class for a set state.

The assumed boolean state indicates whether the corresponding set is full set or not. If the assumed state is false, this is the worst state. The worst state (invalid state) of set of potential values is when the set contains every possible value (i.e. we cannot in any way limit the value that the target position can take). That never happens naturally, we only force it. As for the conditions under which we force it, see AAPotentialConstantValues.

Definition at line 5013 of file Attributor.h.

Member Typedef Documentation

◆ SetTy

template<typename MemberTy>
using llvm::PotentialValuesState< MemberTy >::SetTy = SmallSetVector<MemberTy, 8>

Definition at line 5014 of file Attributor.h.

Constructor & Destructor Documentation

◆ PotentialValuesState() [1/2]

template<typename MemberTy>
llvm::PotentialValuesState< MemberTy >::PotentialValuesState ( )
inline

◆ PotentialValuesState() [2/2]

template<typename MemberTy>
llvm::PotentialValuesState< MemberTy >::PotentialValuesState ( bool IsValid)
inline

Definition at line 5018 of file Attributor.h.

Member Function Documentation

◆ contains()

template<typename MemberTy>
bool llvm::PotentialValuesState< MemberTy >::contains ( const MemberTy & V) const
inline

Definition at line 5104 of file Attributor.h.

◆ getAssumed() [1/2]

template<typename MemberTy>
PotentialValuesState & llvm::PotentialValuesState< MemberTy >::getAssumed ( )
inline

Return the assumed state.

Definition at line 5038 of file Attributor.h.

◆ getAssumed() [2/2]

template<typename MemberTy>
const PotentialValuesState & llvm::PotentialValuesState< MemberTy >::getAssumed ( ) const
inline

Definition at line 5039 of file Attributor.h.

◆ getAssumedSet() [1/2]

template<typename MemberTy>
SetTy & llvm::PotentialValuesState< MemberTy >::getAssumedSet ( )
inlineprotected

Definition at line 5109 of file Attributor.h.

◆ getAssumedSet() [2/2]

template<typename MemberTy>
const SetTy & llvm::PotentialValuesState< MemberTy >::getAssumedSet ( ) const
inline

Return this set.

We should check whether this set is valid or not by isValidState() before calling this function.

Definition at line 5043 of file Attributor.h.

Referenced by llvm::operator<<(), and llvm::operator<<().

◆ getBestState() [1/2]

template<typename MemberTy>
PotentialValuesState llvm::PotentialValuesState< MemberTy >::getBestState ( )
inlinestatic

Return empty set as the best state of potential values.

Definition at line 5069 of file Attributor.h.

Referenced by llvm::PotentialValuesState< APInt >::getBestState().

◆ getBestState() [2/2]

template<typename MemberTy>
PotentialValuesState llvm::PotentialValuesState< MemberTy >::getBestState ( const PotentialValuesState< MemberTy > & PVS)
inlinestatic

Definition at line 5073 of file Attributor.h.

◆ getWorstState()

template<typename MemberTy>
PotentialValuesState llvm::PotentialValuesState< MemberTy >::getWorstState ( )
inlinestatic

Return full set as the worst state of potential values.

Definition at line 5078 of file Attributor.h.

◆ indicateOptimisticFixpoint()

template<typename MemberTy>
ChangeStatus llvm::PotentialValuesState< MemberTy >::indicateOptimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicateOptimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 5033 of file Attributor.h.

◆ indicatePessimisticFixpoint()

template<typename MemberTy>
ChangeStatus llvm::PotentialValuesState< MemberTy >::indicatePessimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicatePessimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 5028 of file Attributor.h.

◆ isAtFixpoint()

template<typename MemberTy>
bool llvm::PotentialValuesState< MemberTy >::isAtFixpoint ( ) const
inlineoverridevirtual

See AbstractState::isAtFixpoint(...)

Implements llvm::AbstractState.

Definition at line 5025 of file Attributor.h.

◆ isValidState()

◆ operator&=()

template<typename MemberTy>
PotentialValuesState llvm::PotentialValuesState< MemberTy >::operator&= ( const PotentialValuesState< MemberTy > & PVS)
inline

Definition at line 5098 of file Attributor.h.

◆ operator==()

template<typename MemberTy>
bool llvm::PotentialValuesState< MemberTy >::operator== ( const PotentialValuesState< MemberTy > & RHS) const
inline

Definition at line 5054 of file Attributor.h.

◆ operator^=()

template<typename MemberTy>
PotentialValuesState llvm::PotentialValuesState< MemberTy >::operator^= ( const PotentialValuesState< MemberTy > & PVS)
inline

"Clamp" this state with PVS.

Definition at line 5092 of file Attributor.h.

◆ undefIsContained()

template<typename MemberTy>
bool llvm::PotentialValuesState< MemberTy >::undefIsContained ( ) const
inline

Returns whether this state contains an undef value or not.

Definition at line 5049 of file Attributor.h.

Referenced by llvm::operator<<(), llvm::operator<<(), and llvm::PotentialValuesState< APInt >::operator==().

◆ unionAssumed() [1/2]

template<typename MemberTy>
void llvm::PotentialValuesState< MemberTy >::unionAssumed ( const MemberTy & C)
inline

Union assumed set with the passed value.

Definition at line 5083 of file Attributor.h.

Referenced by llvm::PotentialValuesState< APInt >::operator&=(), and llvm::PotentialValuesState< APInt >::operator^=().

◆ unionAssumed() [2/2]

template<typename MemberTy>
void llvm::PotentialValuesState< MemberTy >::unionAssumed ( const PotentialValuesState< MemberTy > & PVS)
inline

Union assumed set with assumed set of the passed state PVS.

Definition at line 5086 of file Attributor.h.

◆ unionAssumedWithUndef()

template<typename MemberTy>
void llvm::PotentialValuesState< MemberTy >::unionAssumedWithUndef ( )
inline

Union assumed set with an undef value.

Definition at line 5089 of file Attributor.h.

Member Data Documentation

◆ MaxPotentialValues

template<typename MemberTy>
unsigned llvm::PotentialValuesState< MemberTy >::MaxPotentialValues
static

Maximum number of potential values to be tracked.

This is set by -attributor-max-potential-values command line option

Definition at line 5066 of file Attributor.h.


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