LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy > Class Template Reference

#include <AbstractLatticeValue.h>

Public Member Functions

 AbstractLatticeValue (ScalarTy s)
 
 AbstractLatticeValue ()
 
 AbstractLatticeValue (const mlir::ArrayRef< int64_t > shape)
 
 AbstractLatticeValue (const AbstractLatticeValue &rhs)
 
AbstractLatticeValueoperator= (const AbstractLatticeValue &rhs)
 
bool isScalar () const
 
bool isSingleValue () const
 
bool isArray () const
 
const ScalarTy & getScalarValue () const
 
ScalarTy & getScalarValue ()
 
const ArrayTy & getArrayValue () const
 
ArrayTy & getArrayValue ()
 
const Derived & getElemFlatIdx (unsigned i) const
 Directly index into the flattened array using a single index.
 
Derived & getElemFlatIdx (unsigned i)
 
size_t getArraySize () const
 
size_t getNumArrayDims () const
 
void print (mlir::raw_ostream &os) const
 
ScalarTy foldToScalar () const
 If this is an array value, combine all elements into a single scalar value and return it.
 
mlir::ChangeResult setValue (const AbstractLatticeValue &rhs)
 Sets this value to be equal to rhs.
 
mlir::ChangeResult update (const Derived &rhs)
 Union this value with that of rhs.
 
bool operator== (const AbstractLatticeValue &rhs) const
 

Protected Member Functions

std::variant< ScalarTy, ArrayTy > & getValue ()
 
const std::vector< int64_t > & getArrayShape () const
 
int64_t getArrayDim (unsigned i) const
 
void copyArrayShape (const AbstractLatticeValue &rhs)
 
mlir::ChangeResult updateScalar (const ScalarTy &rhs)
 Union this value with the given scalar.
 
mlir::ChangeResult updateArray (const ArrayTy &rhs)
 Union this value with the given array.
 
mlir::ChangeResult foldAndUpdate (const Derived &rhs)
 Folds the current value into a scalar and folds rhs to a scalar and updates the current value to the union of the two scalars.
 

Detailed Description

template<typename Derived, ScalarLatticeValue ScalarTy>
class llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >

Definition at line 40 of file AbstractLatticeValue.h.

Constructor & Destructor Documentation

◆ AbstractLatticeValue() [1/4]

template<typename Derived, ScalarLatticeValue ScalarTy>
llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::AbstractLatticeValue ( ScalarTy s)
inlineexplicit

Definition at line 65 of file AbstractLatticeValue.h.

◆ AbstractLatticeValue() [2/4]

template<typename Derived, ScalarLatticeValue ScalarTy>
llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::AbstractLatticeValue ( )
inline

Definition at line 66 of file AbstractLatticeValue.h.

◆ AbstractLatticeValue() [3/4]

template<typename Derived, ScalarLatticeValue ScalarTy>
llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::AbstractLatticeValue ( const mlir::ArrayRef< int64_t > shape)
inlineexplicit

Definition at line 67 of file AbstractLatticeValue.h.

◆ AbstractLatticeValue() [4/4]

template<typename Derived, ScalarLatticeValue ScalarTy>
llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::AbstractLatticeValue ( const AbstractLatticeValue< Derived, ScalarTy > & rhs)
inline

Definition at line 70 of file AbstractLatticeValue.h.

Member Function Documentation

◆ copyArrayShape()

template<typename Derived, ScalarLatticeValue ScalarTy>
void llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::copyArrayShape ( const AbstractLatticeValue< Derived, ScalarTy > & rhs)
inlineprotected

Definition at line 216 of file AbstractLatticeValue.h.

◆ foldAndUpdate()

template<typename Derived, ScalarLatticeValue ScalarTy>
mlir::ChangeResult llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::foldAndUpdate ( const Derived & rhs)
inlineprotected

Folds the current value into a scalar and folds rhs to a scalar and updates the current value to the union of the two scalars.

Definition at line 241 of file AbstractLatticeValue.h.

◆ foldToScalar()

template<typename Derived, ScalarLatticeValue ScalarTy>
ScalarTy llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::foldToScalar ( ) const
inline

If this is an array value, combine all elements into a single scalar value and return it.

If this is already a scalar value, return the scalar value.

Definition at line 154 of file AbstractLatticeValue.h.

◆ getArrayDim()

template<typename Derived, ScalarLatticeValue ScalarTy>
int64_t llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getArrayDim ( unsigned i) const
inlineprotected

Definition at line 210 of file AbstractLatticeValue.h.

◆ getArrayShape()

template<typename Derived, ScalarLatticeValue ScalarTy>
const std::vector< int64_t > & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getArrayShape ( ) const
inlineprotected

Definition at line 205 of file AbstractLatticeValue.h.

◆ getArraySize()

template<typename Derived, ScalarLatticeValue ScalarTy>
size_t llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getArraySize ( ) const
inline

Definition at line 129 of file AbstractLatticeValue.h.

◆ getArrayValue() [1/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
ArrayTy & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getArrayValue ( )
inline

Definition at line 109 of file AbstractLatticeValue.h.

◆ getArrayValue() [2/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
const ArrayTy & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getArrayValue ( ) const
inline

Definition at line 104 of file AbstractLatticeValue.h.

◆ getElemFlatIdx() [1/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
Derived & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getElemFlatIdx ( unsigned i)
inline

Definition at line 122 of file AbstractLatticeValue.h.

◆ getElemFlatIdx() [2/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
const Derived & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getElemFlatIdx ( unsigned i) const
inline

Directly index into the flattened array using a single index.

Definition at line 115 of file AbstractLatticeValue.h.

◆ getNumArrayDims()

template<typename Derived, ScalarLatticeValue ScalarTy>
size_t llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getNumArrayDims ( ) const
inline

Definition at line 131 of file AbstractLatticeValue.h.

◆ getScalarValue() [1/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
ScalarTy & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getScalarValue ( )
inline

Definition at line 99 of file AbstractLatticeValue.h.

◆ getScalarValue() [2/2]

template<typename Derived, ScalarLatticeValue ScalarTy>
const ScalarTy & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getScalarValue ( ) const
inline

Definition at line 94 of file AbstractLatticeValue.h.

◆ getValue()

template<typename Derived, ScalarLatticeValue ScalarTy>
std::variant< ScalarTy, ArrayTy > & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::getValue ( )
inlineprotected

Definition at line 203 of file AbstractLatticeValue.h.

◆ isArray()

template<typename Derived, ScalarLatticeValue ScalarTy>
bool llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::isArray ( ) const
inline

Definition at line 92 of file AbstractLatticeValue.h.

◆ isScalar()

template<typename Derived, ScalarLatticeValue ScalarTy>
bool llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::isScalar ( ) const
inline

Definition at line 90 of file AbstractLatticeValue.h.

◆ isSingleValue()

template<typename Derived, ScalarLatticeValue ScalarTy>
bool llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::isSingleValue ( ) const
inline

Definition at line 91 of file AbstractLatticeValue.h.

◆ operator=()

template<typename Derived, ScalarLatticeValue ScalarTy>
AbstractLatticeValue & llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::operator= ( const AbstractLatticeValue< Derived, ScalarTy > & rhs)
inline

Definition at line 73 of file AbstractLatticeValue.h.

◆ operator==()

template<typename Derived, ScalarLatticeValue ScalarTy>
bool llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::operator== ( const AbstractLatticeValue< Derived, ScalarTy > & rhs) const
inline

Definition at line 188 of file AbstractLatticeValue.h.

◆ print()

template<typename Derived, ScalarLatticeValue ScalarTy>
void llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::print ( mlir::raw_ostream & os) const
inline

Definition at line 133 of file AbstractLatticeValue.h.

◆ setValue()

template<typename Derived, ScalarLatticeValue ScalarTy>
mlir::ChangeResult llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::setValue ( const AbstractLatticeValue< Derived, ScalarTy > & rhs)
inline

Sets this value to be equal to rhs.

Returns
A mlir::ChangeResult indicating if an update was performed or not.

Definition at line 169 of file AbstractLatticeValue.h.

◆ update()

template<typename Derived, ScalarLatticeValue ScalarTy>
mlir::ChangeResult llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::update ( const Derived & rhs)
inline

Union this value with that of rhs.

Definition at line 178 of file AbstractLatticeValue.h.

◆ updateArray()

template<typename Derived, ScalarLatticeValue ScalarTy>
mlir::ChangeResult llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::updateArray ( const ArrayTy & rhs)
inlineprotected

Union this value with the given array.

Definition at line 230 of file AbstractLatticeValue.h.

◆ updateScalar()

template<typename Derived, ScalarLatticeValue ScalarTy>
mlir::ChangeResult llzk::dataflow::AbstractLatticeValue< Derived, ScalarTy >::updateScalar ( const ScalarTy & rhs)
inlineprotected

Union this value with the given scalar.

Definition at line 219 of file AbstractLatticeValue.h.


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