LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::ValueSimplifyStateType Struct Reference

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

Inheritance diagram for llvm::ValueSimplifyStateType:
Inheritance graph
[legend]

Public Member Functions

 ValueSimplifyStateType (Type *Ty)
 
bool isValidState () const override
 See AbstractState::isValidState(...)
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint(...)
 
ValueSimplifyStateType getAssumed ()
 Return the assumed state encoding.
 
const ValueSimplifyStateTypegetAssumed () const
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...)
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...)
 
ValueSimplifyStateType operator^= (const ValueSimplifyStateType &VS)
 "Clamp" this state with PVS.
 
bool operator== (const ValueSimplifyStateType &RHS) const
 
- 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.
 

Static Public Member Functions

static ValueSimplifyStateType getBestState (Type *Ty)
 
static ValueSimplifyStateType getBestState (const ValueSimplifyStateType &VS)
 
static ValueSimplifyStateType getWorstState (Type *Ty)
 Return the worst possible representable state.
 
static ValueSimplifyStateType getWorstState (const ValueSimplifyStateType &VS)
 

Protected Member Functions

bool unionAssumed (std::optional< Value * > Other)
 Merge Other into the currently assumed simplified value.
 

Protected Attributes

TypeTy
 The type of the original value.
 
BooleanState BS
 Helper to track validity and fixpoint.
 
std::optional< Value * > SimplifiedAssociatedValue
 An assumed simplified value.
 

Detailed Description

Definition at line 4425 of file Attributor.h.

Constructor & Destructor Documentation

◆ ValueSimplifyStateType()

llvm::ValueSimplifyStateType::ValueSimplifyStateType ( Type Ty)
inline

Definition at line 4427 of file Attributor.h.

Member Function Documentation

◆ getAssumed() [1/2]

ValueSimplifyStateType llvm::ValueSimplifyStateType::getAssumed ( )
inline

Return the assumed state encoding.

Definition at line 4454 of file Attributor.h.

◆ getAssumed() [2/2]

const ValueSimplifyStateType & llvm::ValueSimplifyStateType::getAssumed ( ) const
inline

Definition at line 4455 of file Attributor.h.

◆ getBestState() [1/2]

static ValueSimplifyStateType llvm::ValueSimplifyStateType::getBestState ( const ValueSimplifyStateType VS)
inlinestatic

Definition at line 4432 of file Attributor.h.

References getBestState().

◆ getBestState() [2/2]

static ValueSimplifyStateType llvm::ValueSimplifyStateType::getBestState ( Type Ty)
inlinestatic

Definition at line 4429 of file Attributor.h.

References Ty.

Referenced by getBestState().

◆ getWorstState() [1/2]

static ValueSimplifyStateType llvm::ValueSimplifyStateType::getWorstState ( const ValueSimplifyStateType VS)
inlinestatic

Definition at line 4443 of file Attributor.h.

References getWorstState().

◆ getWorstState() [2/2]

static ValueSimplifyStateType llvm::ValueSimplifyStateType::getWorstState ( Type Ty)
inlinestatic

Return the worst possible representable state.

Definition at line 4437 of file Attributor.h.

References Ty.

Referenced by getWorstState().

◆ indicateOptimisticFixpoint()

ChangeStatus llvm::ValueSimplifyStateType::indicateOptimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicateOptimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4463 of file Attributor.h.

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

◆ indicatePessimisticFixpoint()

ChangeStatus llvm::ValueSimplifyStateType::indicatePessimisticFixpoint ( )
inlineoverridevirtual

See AbstractState::indicatePessimisticFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4458 of file Attributor.h.

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

◆ isAtFixpoint()

bool llvm::ValueSimplifyStateType::isAtFixpoint ( ) const
inlineoverridevirtual

See AbstractState::isAtFixpoint(...)

Implements llvm::AbstractState.

Definition at line 4451 of file Attributor.h.

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

◆ isValidState()

bool llvm::ValueSimplifyStateType::isValidState ( ) const
inlineoverridevirtual

See AbstractState::isValidState(...)

Implements llvm::AbstractState.

Definition at line 4448 of file Attributor.h.

References BS, and llvm::IntegerStateBase< base_ty, BestState, WorstState >::isValidState().

Referenced by operator==().

◆ operator==()

bool llvm::ValueSimplifyStateType::operator== ( const ValueSimplifyStateType RHS) const
inline

Definition at line 4474 of file Attributor.h.

References isValidState(), RHS, and SimplifiedAssociatedValue.

◆ operator^=()

ValueSimplifyStateType llvm::ValueSimplifyStateType::operator^= ( const ValueSimplifyStateType VS)
inline

"Clamp" this state with PVS.

Definition at line 4468 of file Attributor.h.

References BS, and unionAssumed().

◆ unionAssumed()

bool ValueSimplifyStateType::unionAssumed ( std::optional< Value * >  Other)
protected

Merge Other into the currently assumed simplified value.

---------------— Value Simplify Attribute -------------------------—

Definition at line 6078 of file AttributorAttributes.cpp.

References llvm::AA::combineOptionalValuesInAAValueLatice(), llvm::dbgs(), LLVM_DEBUG, and llvm::Other.

Referenced by operator^=().

Member Data Documentation

◆ BS

BooleanState llvm::ValueSimplifyStateType::BS
protected

Helper to track validity and fixpoint.

Definition at line 4490 of file Attributor.h.

Referenced by indicateOptimisticFixpoint(), indicatePessimisticFixpoint(), isAtFixpoint(), isValidState(), and operator^=().

◆ SimplifiedAssociatedValue

std::optional<Value *> llvm::ValueSimplifyStateType::SimplifiedAssociatedValue
protected

An assumed simplified value.

Initially, it is set to std::nullopt, which means that the value is not clear under current assumption. If in the pessimistic state, getAssumedSimplifiedValue doesn't return this value but returns orignal associated value.

Definition at line 4496 of file Attributor.h.

Referenced by operator==().

◆ Ty

Type* llvm::ValueSimplifyStateType::Ty
protected

The type of the original value.

Definition at line 4484 of file Attributor.h.

Referenced by getBestState(), and getWorstState().


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