LLVM  16.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for llvm::PotentialValuesState< MemberTy >:
Collaboration graph
[legend]

Public Types

using SetTy = SmallSetVector< MemberTy, 8 >
 

Public Member Functions

 PotentialValuesState ()
 
 PotentialValuesState (bool IsValid)
 
bool isValidState () const override
 See AbstractState::isValidState(...) More...
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint(...) More...
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...) More...
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...) More...
 
PotentialValuesStategetAssumed ()
 Return the assumed state. More...
 
const PotentialValuesStategetAssumed () const
 
const SetTygetAssumedSet () const
 Return this set. More...
 
bool undefIsContained () const
 Returns whether this state contains an undef value or not. More...
 
bool operator== (const PotentialValuesState &RHS) const
 
void unionAssumed (const MemberTy &C)
 Union assumed set with the passed value. More...
 
void unionAssumed (const PotentialValuesState &PVS)
 Union assumed set with assumed set of the passed state PVS. More...
 
void unionAssumedWithUndef ()
 Union assumed set with an undef value. More...
 
PotentialValuesState operator^= (const PotentialValuesState &PVS)
 "Clamp" this state with PVS. More...
 
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. More...
 
static PotentialValuesState getBestState (const PotentialValuesState &PVS)
 
static PotentialValuesState getWorstState ()
 Return full set as the worst state of potential values. More...
 

Static Public Attributes

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

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 4423 of file Attributor.h.

Member Typedef Documentation

◆ SetTy

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

Definition at line 4424 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 4428 of file Attributor.h.

Member Function Documentation

◆ contains()

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

◆ getAssumed() [1/2]

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

Return the assumed state.

Definition at line 4448 of file Attributor.h.

◆ getAssumed() [2/2]

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

Definition at line 4449 of file Attributor.h.

◆ getAssumedSet() [1/2]

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

◆ 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 4453 of file Attributor.h.

References assert(), and llvm::PotentialValuesState< MemberTy >::isValidState().

Referenced by llvm::AAPotentialConstantValues::getAssumedConstant().

◆ getBestState() [1/2]

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

Return empty set as the best state of potential values.

Definition at line 4479 of file Attributor.h.

References llvm::PotentialValuesState< MemberTy >::PotentialValuesState().

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

◆ getBestState() [2/2]

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

◆ getWorstState()

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

Return full set as the worst state of potential values.

Definition at line 4488 of file Attributor.h.

References llvm::PotentialValuesState< MemberTy >::PotentialValuesState().

◆ indicateOptimisticFixpoint()

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

See AbstractState::indicateOptimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4443 of file Attributor.h.

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

◆ indicatePessimisticFixpoint()

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

See AbstractState::indicatePessimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4438 of file Attributor.h.

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

◆ isAtFixpoint()

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

See AbstractState::isAtFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4435 of file Attributor.h.

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

◆ isValidState()

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

◆ operator&=()

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

◆ operator==()

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

◆ operator^=()

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

"Clamp" this state with PVS.

Definition at line 4502 of file Attributor.h.

References llvm::PotentialValuesState< MemberTy >::unionAssumed().

◆ undefIsContained()

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

Returns whether this state contains an undef value or not.

Definition at line 4459 of file Attributor.h.

References assert(), and llvm::PotentialValuesState< MemberTy >::isValidState().

Referenced by llvm::AAPotentialConstantValues::getAssumedConstant(), and llvm::PotentialValuesState< MemberTy >::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 4493 of file Attributor.h.

Referenced by llvm::PotentialValuesState< MemberTy >::operator&=(), and llvm::PotentialValuesState< MemberTy >::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 4496 of file Attributor.h.

◆ unionAssumedWithUndef()

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

Union assumed set with an undef value.

Definition at line 4499 of file Attributor.h.

Member Data Documentation

◆ MaxPotentialValues

unsigned llvm::PotentialLLVMValuesState::MaxPotentialValues = 0
static

Maximum number of potential values to be tracked.

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

Definition at line 4476 of file Attributor.h.


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