LLZK 0.1.0
Veridise's ZK Language IR
|
LLZK array operations.
n-dimensional array
Syntax:
Array type with a ranked shape and homogeneous element type. It can only be instantiated with the following types:
Parameter | C++ type | Description |
---|---|---|
elementType | mlir::Type | Type of all elements within the array. |
dimensionSizes | ::llvm::ArrayRef<::mlir::Attribute> | List of array dimension size specifiers. |
shape | ::llvm::ArrayRef<int64_t> | Array shape, for ShapedTypeInterface, computed from $dimensionSizes . |
LLZK boolean operations.
bool.and
(::llzk::boolean::AndBoolOp)Logical AND operator
Syntax:
This operation computes the logical AND (i.e. conjunction) of two i1
(i.e. boolean) values as an i1
value. The result is 1
if the operation is true and 0
otherwise.
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | 1-bit signless integer or type variable |
rhs | 1-bit signless integer or type variable |
Result | Description |
---|---|
result | 1-bit signless integer |
bool.assert
(::llzk::boolean::AssertOp)Assertion operation
Syntax:
This operation asserts that a given boolean value is true. Assertions are checked statically when possible. If the condition evaluates to true
, the assertion is removed. If false
, an error is reported. Otherwise, the assertion is preserved. All assertions that appear in constrain()
functions must evaluate statically (i.e. they cannot depend on inputs to the circuit) else an error is reported.
Assertion without message:
Assertion with a message:
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
msg | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
condition | 1-bit signless integer |
bool.cmp
(::llzk::boolean::CmpOp)Compare field element values
Syntax:
This operation takes two field element values and compares them according to the comparison predicate and returns an i1
. The following comparisons are supported:
eq
: equalne
: not equallt
: less thanle
: less than or equalgt
: greater thange
: greater than or equalThe result is 1
if the comparison is true and 0
otherwise.
The inequality operators (lt, gt, le, ge) for the finite field elements are defined by treating the field elements as integer values: f1 op f2
iff int(f1) op int(f2)
Example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attribute | MLIR Type | Description |
---|---|---|
predicate | ::llzk::boolean::FeltCmpPredicateAttr | Field element comparison predicate |
Operand | Description |
---|---|
lhs | finite field element |
rhs | finite field element |
Result | Description |
---|---|
result | 1-bit signless integer |
bool.not
(::llzk::boolean::NotBoolOp)Logical NOT operator
Syntax:
This operation computes the logical NOT (i.e. negation) of an i1
(i.e. boolean) value as an i1
value. The result is 1
if the operation is true and 0
otherwise.
Traits: AlwaysSpeculatableImplTrait
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
operand | 1-bit signless integer or type variable |
Result | Description |
---|---|
result | 1-bit signless integer |
bool.or
(::llzk::boolean::OrBoolOp)Logical OR operator
Syntax:
This operation computes the logical OR (i.e. disjunction) of two i1
(i.e. boolean) values as an i1
value. The result is 1
if the operation is true and 0
otherwise.
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | 1-bit signless integer or type variable |
rhs | 1-bit signless integer or type variable |
Result | Description |
---|---|
result | 1-bit signless integer |
bool.xor
(::llzk::boolean::XorBoolOp)Logical XOR operator
Syntax:
This operation computes the logical XOR (i.e. exclusive disjunction) of two i1
(i.e. boolean) values as an i1
value. The result is 1
if the operation is true and 0
otherwise.
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | 1-bit signless integer or type variable |
rhs | 1-bit signless integer or type variable |
Result | Description |
---|---|
result | 1-bit signless integer |
Field element comparison predicate
Syntax:
Enum cases:
EQ
)NE
)LT
)LE
)GT
)GE
) Parameter | C++ type | Description |
---|---|---|
value | llzk::boolean::FeltCmpPredicate | an enum of type FeltCmpPredicate |
LLZK type conversion operations.
cast.tofelt
(::llzk::cast::IntToFeltOp)Convert an integer into a field element
Syntax:
This operation converts a supported integer type value into a field element value.
Example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
value | 1-bit signless integer or index |
Result | Description |
---|---|
result | finite field element |
cast.toindex
(::llzk::cast::FeltToIndexOp)Convert a field element into an index
Syntax:
This operation converts a field element value into an index value to allow use as an array index or loop bound. In struct @constrain functions, the argument to this op is not allowed to be derived from a Signal struct.
Example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
value | finite field element |
Result | Description |
---|---|
result | index |
LLZK constraint emission operations.
constrain.eq
(::llzk::constrain::EmitEqualityOp)Emit an equality constraint
Syntax:
Emits an equality constraint between lhs and rhs. For the built-in Signal struct, the constraint is performed on the Signal's inner @reg
felt field.
Traits: Commutative
, ConstraintGen
, Elementwise
, Scalarizable
, Tensorizable
, Vectorizable
Interfaces: ConstraintOpInterface
, SymbolUserOpInterface
Operand | Description |
---|---|
lhs | any LLZK type, excluding non-Signal struct and string types |
rhs | any LLZK type, excluding non-Signal struct and string types |
constrain.in
(::llzk::constrain::EmitContainmentOp)Emit a containment constraint
Syntax:
Traits: ConstraintGen
Interfaces: ConstraintOpInterface
, SymbolUserOpInterface
Operand | Description |
---|---|
lhs | n-dimensional array |
rhs | a valid array element type |
LLZK felt (Field ELemenT) type and operations.
felt.add
(::llzk::felt::AddFeltOp)Addition operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, Commutative
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.bit_and
(::llzk::felt::AndFeltOp)Bitwise AND operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.bit_not
(::llzk::felt::NotFeltOp)Bit flip operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
operand | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.bit_or
(::llzk::felt::OrFeltOp)Bitwise OR operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.bit_xor
(::llzk::felt::XorFeltOp)Bitwise XOR operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, Commutative
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.const
(::llzk::felt::FeltConstantOp)Field element constant
Syntax:
This operation produces a felt-typed SSA value holding an integer constant.
Example:
Traits: AlwaysSpeculatableImplTrait
, ConstantLike
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
, OpAsmOpInterface
Effects: MemoryEffects::Effect{}
Attribute | MLIR Type | Description |
---|---|---|
value | ::llzk::felt::FeltConstAttr | finite field element |
Result | Description |
---|---|
result | finite field element |
felt.div
(::llzk::felt::DivFeltOp)Division operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.inv
(::llzk::felt::InvFeltOp)Inverse operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
operand | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.mod
(::llzk::felt::ModFeltOp)Modulus/remainder operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.mul
(::llzk::felt::MulFeltOp)Multiplication operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, Commutative
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.neg
(::llzk::felt::NegFeltOp)Negation operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
operand | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.nondet
(::llzk::felt::FeltNonDetOp)Uninitialized field element
Syntax:
This operation produces a felt-typed SSA value without a specified value. This can be used in constrain()
functions in place of expressions that cannot be included in constraints.
Example:
Traits: AlwaysSpeculatableImplTrait
, ConstantLike
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
, OpAsmOpInterface
Effects: MemoryEffects::Effect{}
Result | Description |
---|---|
result | finite field element |
felt.shl
(::llzk::felt::ShlFeltOp)Left shift operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.shr
(::llzk::felt::ShrFeltOp)Right shift operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
, WitnessGen
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
felt.sub
(::llzk::felt::SubFeltOp)Subtraction operator for field elements
Syntax:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, InferTypeOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
lhs | finite field element or type variable |
rhs | finite field element or type variable |
Result | Description |
---|---|
result | finite field element |
finite field element
Syntax:
A felt attribute represents a finite field element.
Parameter | C++ type | Description |
---|---|---|
value | ::llvm::APInt | The felt constant value |
finite field element
Syntax: !felt.type
LLZK function operations.
function.call
(::llzk::function::CallOp)Call operation
Syntax:
The function.call
operation represents a call to another function. The operands and result types of the call must match the specified function type. The callee is encoded as a symbol reference attribute named "callee" which must be the full path to the target function from the root module (i.e. the module containing the [llzk::LANG_ATTR_NAME] attribute).
Example:
When the return StructType of a compute()
function uses AffineMapAttr to express struct parameter(s) that depend on a loop variable, the optional instantiation parameter list of this operation must be used to instatiate all AffineMap used as parameters to the StructType.
Examples:
Traits: AttrSizedOperandSegments
, MemRefsNormalizable
, VerifySizesForMultiAffineOps<1>
Interfaces: CallOpInterface
, SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
callee | ::mlir::SymbolRefAttr | symbol reference attribute |
numDimsPerMap | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
mapOpGroupSizes | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operand | Description |
---|---|
argOperands | variadic of a valid LLZK type |
mapOperands | variadic of index |
Result | Description |
---|---|
«unnamed» | variadic of a valid LLZK type |
function.def
(::llzk::function::FuncDefOp)An operation with a name containing a single SSACFG
region
Operations within the function cannot implicitly capture values defined outside of the function, i.e. Functions are IsolatedFromAbove
. All external references must use function arguments or attributes that establish a symbolic connection (e.g. symbols referenced by name via a string attribute like SymbolRefAttr). An external function declaration (used when referring to a function declared in some other module) has no body. While the MLIR textual form provides a nice inline syntax for function arguments, they are internally represented as “block arguments” to the first block in the region.
Only dialect attribute names may be specified in the attribute dictionaries for function arguments, results, or the function itself.
Example:
Traits: AffineScope
, AutomaticAllocationScope
, HasParent<::mlir::ModuleOp, llzk::component::StructDefOp>
, IsolatedFromAbove
Interfaces: CallableOpInterface
, FunctionOpInterface
, SymbolUserOpInterface
, Symbol
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
function_type | ::mlir::TypeAttr | type attribute of function type |
arg_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
res_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
function.return
(::llzk::function::ReturnOp)Function return operation
Syntax:
The function.return
operation represents a return operation within a function. The operation takes variable number of operands and produces no results. The operand number and types must match the signature of the function that contains the operation.
Example:
Traits: AlwaysSpeculatableImplTrait
, HasParent<::llzk::function::FuncDefOp>
, MemRefsNormalizable
, ReturnLike
, Terminator
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
, RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
operands | variadic of a valid LLZK type |
LLZK support for global values, defined outside of structs.
global.def
(::llzk::global::GlobalDefOp)Global value
Syntax:
Examples:
Traits: HasParent<mlir::ModuleOp>
Interfaces: SymbolUserOpInterface
, Symbol
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
constant | ::mlir::UnitAttr | unit attribute |
type | ::mlir::TypeAttr | type attribute of any LLZK type except non-constant types |
initial_value | ::mlir::Attribute | any attribute |
global.read
(::llzk::global::GlobalReadOp)Read value of a global
Syntax:
This operation reads the value of a named global.
Interfaces: GlobalRefOpInterface
, SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
name_ref | ::mlir::SymbolRefAttr | symbol reference attribute |
Result | Description |
---|---|
val | any LLZK type except non-constant types |
global.write
(::llzk::global::GlobalWriteOp)Write value to a global
Syntax:
This operation writes a value to a named global. Not allowed for globals declared with the "const" modifier.
Traits: WitnessGen
Interfaces: GlobalRefOpInterface
, SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
name_ref | ::mlir::SymbolRefAttr | symbol reference attribute |
Operand | Description |
---|---|
val | any LLZK type except non-constant types |
LLZK include operations.
include.from
(::llzk::include::IncludeOp)Include operation
Syntax:
This operation imports the contents of another source file in place of itself.
Example:
Traits: HasParent<::mlir::ModuleOp>
Interfaces: Symbol
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
path | ::mlir::StringAttr | string attribute |
Common LLZK attributes.
Annotation with the bounds of a loop
Syntax:
This attribute holds information useful for the analysis of loops. Holds the bounds of the loop and the step size.
Example:
Parameter | C++ type | Description |
---|---|---|
lower | ::llvm::APInt | Loop variable lower bound (inclusive) |
upper | ::llvm::APInt | Loop variable upper bound (exclusive) |
step | ::llvm::APInt | Loop variable step/increment |
A unit attribute to mark a type as public
Syntax: #llzk.pub
Examples:
LLZK types and operations to support templated/parameterized structs.
poly.applymap
(::llzk::polymorphic::ApplyMapOp)Apply an AffineMap
Syntax:
This operation applies an AffineMap to a list of SSA values, yielding a single SSA value. The number of dimension and symbol arguments must be equal to the respective number of dimensional and symbolic inputs to the AffineMap; the AffineMap has to be one-dimensional, and so this operation always returns one value. The input operands and result all have index
type.
Named map example:
Inline example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attribute | MLIR Type | Description |
---|---|---|
map | ::mlir::AffineMapAttr | AffineMap attribute |
numDims | ::mlir::IntegerAttr | index attribute |
Operand | Description |
---|---|
mapOperands | variadic of index |
Result | Description |
---|---|
«unnamed» | index |
poly.read_const
(::llzk::polymorphic::ConstReadOp)Read value of a struct parameter
Syntax:
This operation reads the value from the named constant parameter of the struct/component in which this op appears. The op itself puts some restriction on the type of this value, but leaves it to a later type-checking pass to ensure the struct parameters are instantiated with types matching the uses of the parameter within the struct.
Interfaces: SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
const_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Result | Description |
---|---|
val | integral, felt, or typevar type |
poly.unifiable_cast
(::llzk::polymorphic::UnifiableCastOp)Cast between two unifiable types
Syntax:
This operation reinterprets a value as a different type with the restriction that the input and output types of the cast are unifiable.
Most ops that accept LLZK types accept unifiable types as input and thus there is no need for casting between types. This op is meant to be used in situations where is not possible to modify the given or the target type and they are different but unifiable. For example, inside a conversion pattern the driver may introduce unrealized_conversion_cast
operations if the types are not equal. This will happen regardless of whether the two types unify. This cast can be introduced instead of the default cast operation to satisfy MLIR's assumptions on type equality.
Example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
input | a valid LLZK type |
Result | Description |
---|---|
result | a valid LLZK type |
type variable
Syntax:
This type serves as a placeholder for a type that is instantiated via a parameter of the struct.
For example, we can define a struct that holds a size-2 array where the type of the elements in the array is specified by a parameter of the struct and instantiated with a specific type at the uses of the struct.
Parameter | C++ type | Description |
---|---|---|
nameRef | ::mlir::FlatSymbolRefAttr | reference to the struct parameter |
LLZK string type and operations.
string.new
(::llzk::string::LitStringOp)Literal string
Syntax:
Traits: AlwaysSpeculatableImplTrait
, ConstantLike
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attribute | MLIR Type | Description |
---|---|---|
value | ::mlir::StringAttr | string attribute |
Result | Description |
---|---|
result | string type |
string type
Syntax: !string.type
LLZK component/struct operations.
struct.def
(::llzk::component::StructDefOp)Circuit component definition
Syntax:
This operation describes a component in a circuit. It can contain any number of fields that hold inputs, outputs, intermediate values, and subcomponents of the defined component. It also contains a compute()
function that holds the witness generation code for the component and a constrain()
function that holds that constraint generation code for the component.
Example:
Traits: HasOnlyGraphRegion
, HasParent<::mlir::ModuleOp>
, IsolatedFromAbove
, NoTerminator
, SetFuncAllowAttrs
, SingleBlock
, SymbolTable
Interfaces: RegionKindInterface
, SymbolUserOpInterface
, Symbol
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
const_params | ::mlir::ArrayAttr | flat symbol ref array attribute |
struct.field
(::llzk::component::FieldDefOp)Struct field definition
Syntax:
This operation describes a field in a struct/component.
Example:
Traits: HasParent<::llzk::component::StructDefOp>
Interfaces: SymbolUserOpInterface
, Symbol
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
type | ::mlir::TypeAttr | type attribute of a valid LLZK type |
column | ::mlir::UnitAttr | unit attribute |
struct.new
(::llzk::component::CreateStructOp)Create a new struct
Syntax:
This operation creates a new, uninitialized instance of a struct.
Example:
Traits: WitnessGen
Interfaces: OpAsmOpInterface
, SymbolUserOpInterface
Result | Description |
---|---|
result | circuit component |
struct.readf
(::llzk::component::FieldReadOp)Read value of a struct field
Syntax:
This operation reads the value of a named field in a struct/component.
The value can be read from the signals table, in which case it can be offset by a constant value. A negative value represents reading a value backwards and a positive value represents reading a value forward. Only fields marked as columns can be read in this manner.
Traits: VerifySizesForMultiAffineOps<1>
Interfaces: FieldRefOpInterface
, SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
field_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
tableOffset | ::mlir::Attribute | symbol reference attribute or index attribute or AffineMap attribute |
numDimsPerMap | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
mapOpGroupSizes | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operand | Description |
---|---|
component | circuit component |
mapOperands | variadic of index |
Result | Description |
---|---|
val | a valid LLZK type |
struct.writef
(::llzk::component::FieldWriteOp)Write value to a struct field
Syntax:
This operation writes a value to a named field in a struct/component.
Traits: WitnessGen
Interfaces: FieldRefOpInterface
, SymbolUserOpInterface
Attribute | MLIR Type | Description |
---|---|---|
field_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operand | Description |
---|---|
component | circuit component |
val | a valid LLZK type |
circuit component
Syntax:
Parameter | C++ type | Description |
---|---|---|
nameRef | ::mlir::SymbolRefAttr | Fully-qualified name of the struct definition. |
params | ::mlir::ArrayAttr | Struct parameters |
LLZK undefined value support operations.
undef.undef
(::llzk::undef::UndefOp)Creates an undefined value of the specified type.
Syntax:
This operation has no operands or attributes. It represents an undefined value of the specified LLZK IR dialect type. This op can be introduced by the llzk-array-to-scalar
pass if there is a read from an array index that was not dominated by an earlier write to that same index.
Example:
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Result | Description |
---|---|
res | a valid LLZK type |