LLVM  14.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]
Collaboration diagram for llvm::BitIntegerState< base_ty, BestState, WorstState >:
Collaboration graph
[legend]

Public Types

using base_t = base_ty
 
- Public Types inherited from llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >
using base_t = uint32_t
 

Public Member Functions

bool isKnown (base_t BitsEncoding) const
 Return true if the bits set in BitsEncoding are "known bits". More...
 
bool isAssumed (base_t BitsEncoding) const
 Return true if the bits set in BitsEncoding are "assumed bits". More...
 
BitIntegerStateaddKnownBits (base_t Bits)
 Add the bits in BitsEncoding to the "known bits". More...
 
BitIntegerStateremoveAssumedBits (base_t BitsEncoding)
 Remove the bits in BitsEncoding from the "assumed bits" if not known. More...
 
BitIntegerStateremoveKnownBits (base_t BitsEncoding)
 Remove the bits in BitsEncoding from the "known bits". More...
 
BitIntegerStateintersectAssumedBits (base_t BitsEncoding)
 Keep only "assumed bits" also set in BitsEncoding but all known ones. More...
 
- Public Member Functions inherited from llvm::IntegerStateBase< uint32_t, ~uint32_t(0), 0 >
 IntegerStateBase ()
 
 IntegerStateBase (base_t Assumed)
 
bool isValidState () const override
 See AbstractState::isValidState() NOTE: For now we simply pretend that the worst possible state is invalid. More...
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint() More...
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...) More...
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...) More...
 
base_t getKnown () const
 Return the known state encoding. More...
 
base_t getAssumed () const
 Return the assumed state encoding. More...
 
bool operator== (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Equality for IntegerStateBase. More...
 
bool operator!= (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Inequality for IntegerStateBase. More...
 
void operator^= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R. More...
 
void operator+= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R. More...
 
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 ()
 
virtual bool isValidState () const =0
 Return if this abstract state is in a valid state. More...
 
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. More...
 

Additional Inherited Members

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

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 2216 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 2218 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

Add the bits in BitsEncoding to the "known bits".

Definition at line 2231 of file Attributor.h.

◆ 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

Keep only "assumed bits" also set in BitsEncoding but all known ones.

Definition at line 2250 of file Attributor.h.

Referenced by llvm::BitIntegerState< uint16_t, 7, 0 >::removeAssumedBits().

◆ 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) const
inline

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

Definition at line 2226 of file Attributor.h.

◆ 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) const
inline

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

Definition at line 2221 of file Attributor.h.

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

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


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