LLZK 0.1.0
Veridise's ZK Language IR
|
A value at a given point of the ConstrainRefLattice. More...
#include <ConstrainRefLattice.h>
Public Member Functions | |
ConstrainRefLatticeValue (ScalarTy s) | |
ConstrainRefLatticeValue (ConstrainRef r) | |
ConstrainRefLatticeValue () | |
ConstrainRefLatticeValue (mlir::ArrayRef< int64_t > shape) | |
const ConstrainRef & | getSingleValue () const |
mlir::ChangeResult | insert (const ConstrainRef &rhs) |
Directly insert the ref into this value. | |
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > | translate (const TranslationMap &translation) const |
For the refs contained in this value, translate them given the translation map and return the transformed value. | |
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > | referenceField (SymbolLookupResult< component::FieldDefOp > fieldRef) const |
Add the given fieldRef to the constrain refs contained within this value. | |
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > | extract (const std::vector< ConstrainRefIndex > &indices) const |
Perform an array.extract or array.read operation, depending on how many indices are provided. | |
![]() | |
AbstractLatticeValue (ScalarTy s) | |
AbstractLatticeValue () | |
AbstractLatticeValue (const mlir::ArrayRef< int64_t > shape) | |
AbstractLatticeValue (const AbstractLatticeValue &rhs) | |
AbstractLatticeValue & | operator= (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 ConstrainRefLatticeValue & | getElemFlatIdx (unsigned i) const |
Directly index into the flattened array using a single index. | |
ConstrainRefLatticeValue & | 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 ConstrainRefLatticeValue &rhs) |
Union this value with that of rhs. | |
bool | operator== (const AbstractLatticeValue &rhs) const |
AbstractLatticeValue (ScalarTy s) | |
AbstractLatticeValue () | |
AbstractLatticeValue (const mlir::ArrayRef< int64_t > shape) | |
AbstractLatticeValue (const AbstractLatticeValue &rhs) | |
AbstractLatticeValue & | operator= (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 ConstrainRefLatticeValue & | getElemFlatIdx (unsigned i) const |
Directly index into the flattened array using a single index. | |
ConstrainRefLatticeValue & | 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 ConstrainRefLatticeValue &rhs) |
Union this value with that of rhs. | |
bool | operator== (const AbstractLatticeValue &rhs) const |
Protected Member Functions | |
mlir::ChangeResult | translateScalar (const TranslationMap &translation) |
Translate this value using the translation map, assuming this value is a scalar. | |
virtual std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > | elementwiseTransform (llvm::function_ref< ConstrainRef(const ConstrainRef &)> transform) const |
Perform a recursive transformation over all elements of this value and return a new value with the modifications. | |
![]() | |
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 ConstrainRefLatticeValue &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. | |
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 ConstrainRefLatticeValue &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. | |
A value at a given point of the ConstrainRefLattice.
Definition at line 24 of file ConstrainRefLattice.h.
|
inlineexplicit |
Definition at line 39 of file ConstrainRefLattice.h.
|
inlineexplicit |
Definition at line 40 of file ConstrainRefLattice.h.
|
inline |
Definition at line 41 of file ConstrainRefLattice.h.
|
inlineexplicit |
Definition at line 44 of file ConstrainRefLattice.h.
|
protectedvirtual |
Perform a recursive transformation over all elements of this value and return a new value with the modifications.
Definition at line 152 of file ConstrainRefLattice.cpp.
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > llzk::ConstrainRefLatticeValue::extract | ( | const std::vector< ConstrainRefIndex > & | indices | ) | const |
Perform an array.extract or array.read operation, depending on how many indices are provided.
Definition at line 69 of file ConstrainRefLattice.cpp.
|
inline |
Definition at line 46 of file ConstrainRefLattice.h.
mlir::ChangeResult llzk::ConstrainRefLatticeValue::insert | ( | const ConstrainRef & | rhs | ) |
Directly insert the ref into this value.
If this is a scalar value, insert the ref into the value's set. If this is an array value, the array is folded into a single scalar, then the ref is inserted.
Definition at line 36 of file ConstrainRefLattice.cpp.
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > llzk::ConstrainRefLatticeValue::referenceField | ( | SymbolLookupResult< component::FieldDefOp > | fieldRef | ) | const |
Add the given fieldRef
to the constrain refs contained within this value.
For example, if fieldRef
is a field reference @foo
and this value represents self
, the new value will represent self[@foo]
.
fieldRef | The field reference into the current value. |
Definition at line 62 of file ConstrainRefLattice.cpp.
std::pair< ConstrainRefLatticeValue, mlir::ChangeResult > llzk::ConstrainRefLatticeValue::translate | ( | const TranslationMap & | translation | ) | const |
For the refs contained in this value, translate them given the translation
map and return the transformed value.
Definition at line 46 of file ConstrainRefLattice.cpp.
|
protected |
Translate this value using the translation map, assuming this value is a scalar.
Definition at line 136 of file ConstrainRefLattice.cpp.