LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::BitIntegerState< base_ty, BestState, WorstState > Struct Template Reference

Specialization of the integer state for a bit-wise encoding. More...

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

Inheritance diagram for llvm::BitIntegerState< base_ty, BestState, WorstState >:
Inheritance graph
[legend]

Public Types

using super = IntegerStateBase< base_ty, BestState, WorstState >
 
using base_t = base_ty
 
- Public Types inherited from llvm::IntegerStateBase< base_ty, BestState, WorstState >
using base_t = base_ty
 

Public Member Functions

 BitIntegerState ()=default
 
 BitIntegerState (base_t Assumed)
 
bool isKnown (base_t BitsEncoding=BestState) const
 Return true if the bits set in BitsEncoding are "known bits".
 
bool isAssumed (base_t BitsEncoding=BestState) const
 Return true if the bits set in BitsEncoding are "assumed bits".
 
BitIntegerStateaddKnownBits (base_t Bits)
 Add the bits in BitsEncoding to the "known bits".
 
BitIntegerStateremoveAssumedBits (base_t BitsEncoding)
 Remove the bits in BitsEncoding from the "assumed bits" if not known.
 
BitIntegerStateremoveKnownBits (base_t BitsEncoding)
 Remove the bits in BitsEncoding from the "known bits".
 
BitIntegerStateintersectAssumedBits (base_t BitsEncoding)
 Keep only "assumed bits" also set in BitsEncoding but all known ones.
 
- Public Member Functions inherited from llvm::IntegerStateBase< base_ty, BestState, WorstState >
 IntegerStateBase ()=default
 
 IntegerStateBase (base_t Assumed)
 
bool isValidState () const override
 See AbstractState::isValidState() NOTE: For now we simply pretend that the worst possible state is invalid.
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint()
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...)
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...)
 
base_t getKnown () const
 Return the known state encoding.
 
base_t getAssumed () const
 Return the assumed state encoding.
 
bool operator== (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Equality for IntegerStateBase.
 
bool operator!= (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Inequality for IntegerStateBase.
 
void operator^= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R.
 
void operator+= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R.
 
void operator|= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 
void operator&= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 
- Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()=default
 
virtual bool isValidState () const =0
 Return if this abstract state is in a valid state.
 
virtual bool isAtFixpoint () const =0
 Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself.
 
virtual ChangeStatus indicateOptimisticFixpoint ()=0
 Indicate that the abstract state should converge to the optimistic state.
 
virtual ChangeStatus indicatePessimisticFixpoint ()=0
 Indicate that the abstract state should converge to the pessimistic state.
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::IntegerStateBase< base_ty, BestState, WorstState >
static constexpr base_t getBestState ()
 Return the best possible representable state.
 
static constexpr base_t getBestState (const IntegerStateBase &)
 
static constexpr base_t getWorstState ()
 Return the worst possible representable state.
 
static constexpr base_t getWorstState (const IntegerStateBase &)
 
virtual void handleNewAssumedValue (base_t Value)=0
 Handle a new assumed value Value. Subtype dependent.
 
virtual void handleNewKnownValue (base_t Value)=0
 Handle a new known value Value. Subtype dependent.
 
virtual void joinOR (base_t AssumedValue, base_t KnownValue)=0
 Handle a value Value. Subtype dependent.
 
virtual void joinAND (base_t AssumedValue, base_t KnownValue)=0
 Handle a new assumed value Value. Subtype dependent.
 
- Protected Attributes inherited from llvm::IntegerStateBase< base_ty, BestState, WorstState >
base_t Known = getWorstState()
 The known state encoding in an integer of type base_t.
 
base_t Assumed = getBestState()
 The assumed state encoding in an integer of type base_t.
 

Detailed Description

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
struct llvm::BitIntegerState< base_ty, BestState, WorstState >

Specialization of the integer state for a bit-wise encoding.

Definition at line 2744 of file Attributor.h.

Member Typedef Documentation

◆ base_t

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
using llvm::BitIntegerState< base_ty, BestState, WorstState >::base_t = base_ty

Definition at line 2747 of file Attributor.h.

◆ super

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
using llvm::BitIntegerState< base_ty, BestState, WorstState >::super = IntegerStateBase<base_ty, BestState, WorstState>

Definition at line 2746 of file Attributor.h.

Constructor & Destructor Documentation

◆ BitIntegerState() [1/2]

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
llvm::BitIntegerState< base_ty, BestState, WorstState >::BitIntegerState ( )
default

◆ BitIntegerState() [2/2]

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
llvm::BitIntegerState< base_ty, BestState, WorstState >::BitIntegerState ( base_t  Assumed)
inline

Definition at line 2749 of file Attributor.h.

Member Function Documentation

◆ addKnownBits()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
BitIntegerState & llvm::BitIntegerState< base_ty, BestState, WorstState >::addKnownBits ( base_t  Bits)
inline

◆ intersectAssumedBits()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
BitIntegerState & llvm::BitIntegerState< base_ty, BestState, WorstState >::intersectAssumedBits ( base_t  BitsEncoding)
inline

◆ isAssumed()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
bool llvm::BitIntegerState< base_ty, BestState, WorstState >::isAssumed ( base_t  BitsEncoding = BestState) const
inline

Return true if the bits set in BitsEncoding are "assumed bits".

Definition at line 2757 of file Attributor.h.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::Assumed.

◆ isKnown()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
bool llvm::BitIntegerState< base_ty, BestState, WorstState >::isKnown ( base_t  BitsEncoding = BestState) const
inline

Return true if the bits set in BitsEncoding are "known bits".

Definition at line 2752 of file Attributor.h.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::Known.

Referenced by llvm::Attributor::isAssumedDead().

◆ removeAssumedBits()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
BitIntegerState & llvm::BitIntegerState< base_ty, BestState, WorstState >::removeAssumedBits ( base_t  BitsEncoding)
inline

Remove the bits in BitsEncoding from the "assumed bits" if not known.

Definition at line 2770 of file Attributor.h.

References llvm::BitIntegerState< base_ty, BestState, WorstState >::intersectAssumedBits().

Referenced by llvm::AANoCapture::determineFunctionCaptureCapabilities().

◆ removeKnownBits()

template<typename base_ty = uint32_t, base_ty BestState = ~base_ty(0), base_ty WorstState = 0>
BitIntegerState & llvm::BitIntegerState< base_ty, BestState, WorstState >::removeKnownBits ( base_t  BitsEncoding)
inline

Remove the bits in BitsEncoding from the "known bits".

Definition at line 2775 of file Attributor.h.

References llvm::IntegerStateBase< base_ty, BestState, WorstState >::Known.


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