LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::PotentialValuesState< MemberTy, KeyInfo > Struct Template Reference

A class for a set state. More...

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

Inheritance diagram for llvm::PotentialValuesState< MemberTy, KeyInfo >:
Inheritance graph
[legend]
Collaboration diagram for llvm::PotentialValuesState< MemberTy, KeyInfo >:
Collaboration graph
[legend]

Public Types

using SetTy = DenseSet< MemberTy, KeyInfo >
 

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)
 
- Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()
 

Static Public Member Functions

static PotentialValuesState getBestState ()
 Return empty set as the best state of potential values. More...
 
static PotentialValuesState getBestState (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...
 

Detailed Description

template<typename MemberTy, typename KeyInfo = DenseMapInfo<MemberTy>>
struct llvm::PotentialValuesState< MemberTy, KeyInfo >

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 AAPotentialValues.

Definition at line 4127 of file Attributor.h.

Member Typedef Documentation

◆ SetTy

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
using llvm::PotentialValuesState< MemberTy, KeyInfo >::SetTy = DenseSet<MemberTy, KeyInfo>

Definition at line 4128 of file Attributor.h.

Constructor & Destructor Documentation

◆ PotentialValuesState() [1/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
llvm::PotentialValuesState< MemberTy, KeyInfo >::PotentialValuesState ( )
inline

◆ PotentialValuesState() [2/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
llvm::PotentialValuesState< MemberTy, KeyInfo >::PotentialValuesState ( bool  IsValid)
inline

Definition at line 4132 of file Attributor.h.

Member Function Documentation

◆ getAssumed() [1/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
PotentialValuesState& llvm::PotentialValuesState< MemberTy, KeyInfo >::getAssumed ( )
inline

Return the assumed state.

Definition at line 4152 of file Attributor.h.

◆ getAssumed() [2/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
const PotentialValuesState& llvm::PotentialValuesState< MemberTy, KeyInfo >::getAssumed ( ) const
inline

Definition at line 4153 of file Attributor.h.

◆ getAssumedSet()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
const SetTy& llvm::PotentialValuesState< MemberTy, KeyInfo >::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 4157 of file Attributor.h.

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

Referenced by llvm::AAPotentialValues::getAssumedConstantInt(), and llvm::PotentialValuesState< MemberTy, KeyInfo >::operator==().

◆ getBestState() [1/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
static PotentialValuesState llvm::PotentialValuesState< MemberTy, KeyInfo >::getBestState ( )
inlinestatic

Return empty set as the best state of potential values.

Definition at line 4183 of file Attributor.h.

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

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

◆ getBestState() [2/2]

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
static PotentialValuesState llvm::PotentialValuesState< MemberTy, KeyInfo >::getBestState ( PotentialValuesState< MemberTy, KeyInfo > &  PVS)
inlinestatic

◆ getWorstState()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
static PotentialValuesState llvm::PotentialValuesState< MemberTy, KeyInfo >::getWorstState ( )
inlinestatic

Return full set as the worst state of potential values.

Definition at line 4192 of file Attributor.h.

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

◆ indicateOptimisticFixpoint()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
ChangeStatus llvm::PotentialValuesState< MemberTy, KeyInfo >::indicateOptimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicateOptimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4147 of file Attributor.h.

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

◆ indicatePessimisticFixpoint()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
ChangeStatus llvm::PotentialValuesState< MemberTy, KeyInfo >::indicatePessimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicatePessimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4142 of file Attributor.h.

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

◆ isAtFixpoint()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
bool llvm::PotentialValuesState< MemberTy, KeyInfo >::isAtFixpoint ( ) const
inlineoverridevirtual

See AbstractState::isAtFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4139 of file Attributor.h.

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

◆ isValidState()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
bool llvm::PotentialValuesState< MemberTy, KeyInfo >::isValidState ( ) const
inlineoverridevirtual

◆ operator&=()

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

◆ operator==()

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

◆ operator^=()

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

"Clamp" this state with PVS.

Definition at line 4206 of file Attributor.h.

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

◆ undefIsContained()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
bool llvm::PotentialValuesState< MemberTy, KeyInfo >::undefIsContained ( ) const
inline

Returns whether this state contains an undef value or not.

Definition at line 4163 of file Attributor.h.

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

Referenced by llvm::AAPotentialValues::getAssumedConstantInt(), and llvm::PotentialValuesState< MemberTy, KeyInfo >::operator==().

◆ unionAssumed() [1/2]

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

Union assumed set with the passed value.

Definition at line 4197 of file Attributor.h.

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

◆ unionAssumed() [2/2]

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

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

Definition at line 4200 of file Attributor.h.

◆ unionAssumedWithUndef()

template<typename MemberTy , typename KeyInfo = DenseMapInfo<MemberTy>>
void llvm::PotentialValuesState< MemberTy, KeyInfo >::unionAssumedWithUndef ( )
inline

Union assumed set with an undef value.

Definition at line 4203 of file Attributor.h.

Member Data Documentation

◆ MaxPotentialValues

unsigned llvm::PotentialConstantIntValuesState::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 4180 of file Attributor.h.


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