LLVM 24.0.0git
llvm::ValueSimplifyStateType Struct Reference

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

Inheritance diagram for llvm::ValueSimplifyStateType:
[legend]

Public Member Functions

 ValueSimplifyStateType (Type *Ty)
bool isValidState () const override
 Return if this abstract state is in a valid state.
bool isAtFixpoint () const override
 Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself.
ValueSimplifyStateType getAssumed ()
 Return the assumed state encoding.
const ValueSimplifyStateType & getAssumed () const
ChangeStatus indicatePessimisticFixpoint () override
 Indicate that the abstract state should converge to the pessimistic state.
ChangeStatus indicateOptimisticFixpoint () override
 Indicate that the abstract state should converge to the optimistic state.
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

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

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

Protected Attributes

Type * Ty
 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 4332 of file Attributor.h.

Constructor & Destructor Documentation

◆ ValueSimplifyStateType()

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

Member Function Documentation

◆ getAssumed() [1/2]

ValueSimplifyStateType llvm::ValueSimplifyStateType::getAssumed ( )
inline

Return the assumed state encoding.

Definition at line 4359 of file Attributor.h.

References ValueSimplifyStateType().

◆ getAssumed() [2/2]

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

Definition at line 4360 of file Attributor.h.

References ValueSimplifyStateType().

◆ getBestState() [1/2]

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

Definition at line 4339 of file Attributor.h.

References getBestState(), and ValueSimplifyStateType().

◆ getBestState() [2/2]

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

Definition at line 4336 of file Attributor.h.

References Ty, and ValueSimplifyStateType().

Referenced by getBestState().

◆ getWorstState() [1/2]

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

Definition at line 4350 of file Attributor.h.

References getWorstState(), and ValueSimplifyStateType().

◆ getWorstState() [2/2]

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

Return the worst possible representable state.

Definition at line 4344 of file Attributor.h.

References Ty, and ValueSimplifyStateType().

Referenced by getWorstState().

◆ indicateOptimisticFixpoint()

ChangeStatus llvm::ValueSimplifyStateType::indicateOptimisticFixpoint ( )
inlineoverridevirtual

Indicate that the abstract state should converge to the optimistic state.

This will usually make the optimistically assumed state the known to be true state.

Returns
ChangeStatus::UNCHANGED as the assumed value should not change.

Implements llvm::AbstractState.

Definition at line 4366 of file Attributor.h.

References BS.

◆ indicatePessimisticFixpoint()

ChangeStatus llvm::ValueSimplifyStateType::indicatePessimisticFixpoint ( )
inlineoverridevirtual

Indicate that the abstract state should converge to the pessimistic state.

This will usually revert the optimistically assumed state to the known to be true state.

Returns
ChangeStatus::CHANGED as the assumed value may change.

Implements llvm::AbstractState.

Definition at line 4362 of file Attributor.h.

References BS.

◆ isAtFixpoint()

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

Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself.

Implements llvm::AbstractState.

Definition at line 4356 of file Attributor.h.

References BS.

◆ isValidState()

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

Return if this abstract state is in a valid state.

If false, no information provided should be used.

Implements llvm::AbstractState.

Definition at line 4354 of file Attributor.h.

References BS.

Referenced by operator==().

◆ operator==()

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

◆ operator^=()

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

"Clamp" this state with PVS.

Definition at line 4371 of file Attributor.h.

References BS, unionAssumed(), and ValueSimplifyStateType().

◆ unionAssumed()

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

Merge Other into the currently assumed simplified value.

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

Definition at line 6126 of file AttributorAttributes.cpp.

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

Referenced by operator^=().

Member Data Documentation

◆ BS

BooleanState llvm::ValueSimplifyStateType::BS
protected

Helper to track validity and fixpoint.

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

Referenced by operator==(), and unionAssumed().

◆ Ty

Type* llvm::ValueSimplifyStateType::Ty
protected

The type of the original value.

Definition at line 4387 of file Attributor.h.

Referenced by getBestState(), getWorstState(), unionAssumed(), and ValueSimplifyStateType().


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