|
LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
|
#include "llzk-c/Support.h"#include <mlir-c/AffineMap.h>#include <mlir-c/IR.h>#include <mlir-c/Support.h>#include <stdint.h>#include "llzk/Dialect/Struct/IR/Ops.capi.h.inc"#include "llzk/Dialect/Struct/IR/Types.capi.h.inc"Go to the source code of this file.
Functions | |
| MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (Struct, llzk__component) | |
| Get reference to the LLZK struct dialect. | |
| MLIR_CAPI_EXPORTED MlirType | llzkStruct_StructTypeGet (MlirAttribute name) |
| Creates a llzk::component::StructType. | |
| MLIR_CAPI_EXPORTED MlirType | llzkStruct_StructTypeGetWithArrayAttr (MlirAttribute name, MlirAttribute params) |
| Creates a llzk::component::StructType with an ArrayAttr as parameters. | |
| MLIR_CAPI_EXPORTED MlirType | llzkStruct_StructTypeGetWithAttrs (MlirAttribute name, intptr_t numParams, MlirAttribute const *params) |
| Creates a llzk::component::StructType with an array of parameters. | |
| MLIR_CAPI_EXPORTED MlirLogicalResult | llzkStructStructTypeGetDefinition (MlirType type, MlirOperation root, LlzkSymbolLookupResult *result) |
| Lookups the definition Operation of the given StructType using the given Operation as root for the lookup. | |
| MLIR_CAPI_EXPORTED MlirLogicalResult | llzkStructStructTypeGetDefinitionFromModule (MlirType type, MlirModule root, LlzkSymbolLookupResult *result) |
| Lookups the definition Operation of the given StructType using the given Module as root for the lookup. | |
| MLIR_CAPI_EXPORTED MlirBlock | llzkStruct_StructDefOpGetBody (MlirOperation op) |
| Returns the single body Block within the StructDefOp's Region. | |
| MLIR_CAPI_EXPORTED MlirType | llzkStruct_StructDefOpGetType (MlirOperation op) |
| Returns the associated StructType to this op using the const params defined by the op. | |
| MLIR_CAPI_EXPORTED MlirType | llzkStruct_StructDefOpGetTypeWithParams (MlirOperation op, MlirAttribute params) |
| Returns the associated StructType to this op using the given const params instead of the parameters defined by the op. | |
| MLIR_CAPI_EXPORTED void | llzkStruct_StructDefOpGetMemberDefs (MlirOperation op, MlirOperation *dst) |
| Fills the given array with the MemberDefOp operations inside this struct. | |
| MLIR_CAPI_EXPORTED intptr_t | llzkStruct_StructDefOpGetNumMemberDefs (MlirOperation op) |
| Returns the number of MemberDefOp operations defined in this struct. | |
| MLIR_CAPI_EXPORTED const char * | llzkStruct_StructDefOpGetHeaderString (MlirOperation op, intptr_t *dstSize, char *(*alloc_string)(size_t)) |
| Returns the header string of the struct. | |
| MLIR_CAPI_EXPORTED void | llzkStruct_StructDefOpGetTemplateParamOpNames (MlirOperation op, MlirAttribute *dst) |
| If this struct.def is within a poly.template, add names of all poly.param within the poly.template in the order they are defined. | |
| MLIR_CAPI_EXPORTED intptr_t | llzkStruct_StructDefOpGetNumTemplateParamOpNames (MlirOperation op) |
| Returns the number of poly.param operations defined within this template. | |
| MLIR_CAPI_EXPORTED void | llzkStruct_StructDefOpGetTemplateExprOpNames (MlirOperation op, MlirAttribute *dst) |
| If this struct.def is within a poly.template, add names of all poly.expr within the poly.template in the order they are defined. | |
| MLIR_CAPI_EXPORTED intptr_t | llzkStruct_StructDefOpGetNumTemplateExprOpNames (MlirOperation op) |
| Returns the number of poly.expr operations defined within this template. | |
| LLZK_DECLARE_OP_BUILD_METHOD (Struct, MemberReadOp, MlirType type, MlirValue component, MlirIdentifier memberName) | |
| Creates a MemberReadOp. | |
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Struct, MemberReadOp, WithAffineMapDistance, MlirType type, MlirValue component, MlirIdentifier memberName, MlirAffineMap affineMap, MlirValueRange mapOperands) | |
| Creates a MemberReadOp to a column offset by the given distance affine map. | |
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Struct, MemberReadOp, WithTemplateSymbolDistance, MlirType type, MlirValue component, MlirIdentifier memberName, MlirStringRef paramName) | |
| Creates a MemberReadOp to a column offset by the given distance defined by a name to a constant parameter in the struct. | |
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Struct, MemberReadOp, WithLiteralDistance, MlirType type, MlirValue component, MlirIdentifier memberName, int64_t distance) | |
| Creates a MemberReadOp to a column offset by the given distance defined by an integer value. | |
| LLZK_DECLARE_OP_BUILD_METHOD | ( | Struct | , |
| MemberReadOp | , | ||
| MlirType | type, | ||
| MlirValue | component, | ||
| MlirIdentifier | memberName ) |
Creates a MemberReadOp.
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD | ( | Struct | , |
| MemberReadOp | , | ||
| WithAffineMapDistance | , | ||
| MlirType | type, | ||
| MlirValue | component, | ||
| MlirIdentifier | memberName, | ||
| MlirAffineMap | affineMap, | ||
| MlirValueRange | mapOperands ) |
Creates a MemberReadOp to a column offset by the given distance affine map.
The values in the ValueRange are operands representing the arguments to the affine map. The integer value is the number of arguments in the map that are dimensions.
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD | ( | Struct | , |
| MemberReadOp | , | ||
| WithLiteralDistance | , | ||
| MlirType | type, | ||
| MlirValue | component, | ||
| MlirIdentifier | memberName, | ||
| int64_t | distance ) |
Creates a MemberReadOp to a column offset by the given distance defined by an integer value.
| LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD | ( | Struct | , |
| MemberReadOp | , | ||
| WithTemplateSymbolDistance | , | ||
| MlirType | type, | ||
| MlirValue | component, | ||
| MlirIdentifier | memberName, | ||
| MlirStringRef | paramName ) |
Creates a MemberReadOp to a column offset by the given distance defined by a name to a constant parameter in the struct.
| MLIR_CAPI_EXPORTED MlirBlock llzkStruct_StructDefOpGetBody | ( | MlirOperation | op | ) |
Returns the single body Block within the StructDefOp's Region.
Definition at line 95 of file Struct.cpp.
| MLIR_CAPI_EXPORTED const char * llzkStruct_StructDefOpGetHeaderString | ( | MlirOperation | op, |
| intptr_t * | dstSize, | ||
| char *(* | alloc_string )(size_t) ) |
Returns the header string of the struct.
The size of the string is written into the given size pointer. The caller is responsible of freeing the string and of providing an allocator.
Definition at line 118 of file Struct.cpp.
| MLIR_CAPI_EXPORTED void llzkStruct_StructDefOpGetMemberDefs | ( | MlirOperation | op, |
| MlirOperation * | dst ) |
Fills the given array with the MemberDefOp operations inside this struct.
The pointer to the operations must have been preallocated. See llzkStruct_StructDefOpGetNumMemberDefs for obtaining the required size of the array.
Definition at line 107 of file Struct.cpp.
| MLIR_CAPI_EXPORTED intptr_t llzkStruct_StructDefOpGetNumMemberDefs | ( | MlirOperation | op | ) |
Returns the number of MemberDefOp operations defined in this struct.
Definition at line 114 of file Struct.cpp.
| MLIR_CAPI_EXPORTED intptr_t llzkStruct_StructDefOpGetNumTemplateExprOpNames | ( | MlirOperation | op | ) |
Returns the number of poly.expr operations defined within this template.
Definition at line 149 of file Struct.cpp.
| MLIR_CAPI_EXPORTED intptr_t llzkStruct_StructDefOpGetNumTemplateParamOpNames | ( | MlirOperation | op | ) |
Returns the number of poly.param operations defined within this template.
Definition at line 136 of file Struct.cpp.
| MLIR_CAPI_EXPORTED void llzkStruct_StructDefOpGetTemplateExprOpNames | ( | MlirOperation | op, |
| MlirAttribute * | dst ) |
If this struct.def is within a poly.template, add names of all poly.expr within the poly.template in the order they are defined.
Otherwise, do nothing. The names are added as FlatSymbolRefAttr but the more general Attribute type is used in the type since that's usually what's needed.
The pointer to the attributes must have been preallocated. See llzkStruct_StructDefOpGetNumTemplateExprOpNames for obtaining the required size of the array.
Definition at line 142 of file Struct.cpp.
| MLIR_CAPI_EXPORTED void llzkStruct_StructDefOpGetTemplateParamOpNames | ( | MlirOperation | op, |
| MlirAttribute * | dst ) |
If this struct.def is within a poly.template, add names of all poly.param within the poly.template in the order they are defined.
Otherwise, do nothing. The names are added as FlatSymbolRefAttr but the more general Attribute type is used in the type since that's usually what's needed.
The pointer to the attributes must have been preallocated. See llzkStruct_StructDefOpGetNumTemplateParamOpNames for obtaining the required size of the array.
Definition at line 129 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirType llzkStruct_StructDefOpGetType | ( | MlirOperation | op | ) |
Returns the associated StructType to this op using the const params defined by the op.
Definition at line 99 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirType llzkStruct_StructDefOpGetTypeWithParams | ( | MlirOperation | op, |
| MlirAttribute | params ) |
Returns the associated StructType to this op using the given const params instead of the parameters defined by the op.
The const params are defined in the given attribute which has to be of type ArrayAttr.
Definition at line 103 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirType llzkStruct_StructTypeGet | ( | MlirAttribute | name | ) |
Creates a llzk::component::StructType.
The name attribute must be a SymbolRefAttr.
Definition at line 47 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirType llzkStruct_StructTypeGetWithArrayAttr | ( | MlirAttribute | name, |
| MlirAttribute | params ) |
Creates a llzk::component::StructType with an ArrayAttr as parameters.
The name attribute must be a SymbolRefAttr.
Definition at line 51 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirType llzkStruct_StructTypeGetWithAttrs | ( | MlirAttribute | name, |
| intptr_t | numParams, | ||
| MlirAttribute const * | params ) |
Creates a llzk::component::StructType with an array of parameters.
The name attribute must be a SymbolRefAttr.
Definition at line 59 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirLogicalResult llzkStructStructTypeGetDefinition | ( | MlirType | type, |
| MlirOperation | root, | ||
| LlzkSymbolLookupResult * | result ) |
Lookups the definition Operation of the given StructType using the given Operation as root for the lookup.
The definition Operation is wrapped in a LlzkSymbolLookupResult that the caller is responsible for cleaning up.
If the function returns 'success' the lookup result will be stored in the given pointer. Accessing the lookup result if the function returns 'failure' is undefined behavior.
Requires that the given Operation implements the SymbolTable op interface.
Definition at line 69 of file Struct.cpp.
| MLIR_CAPI_EXPORTED MlirLogicalResult llzkStructStructTypeGetDefinitionFromModule | ( | MlirType | type, |
| MlirModule | root, | ||
| LlzkSymbolLookupResult * | result ) |
Lookups the definition Operation of the given StructType using the given Module as root for the lookup.
The definition Operation is wrapped in a LlzkSymbolLookupResult that the caller is responsible for cleaning up.
If the function returns 'success' the lookup result will be stored in the given pointer. Accessing the lookup result if the function returns 'failure' is undefined behavior.
Definition at line 85 of file Struct.cpp.
| MLIR_DECLARE_CAPI_DIALECT_REGISTRATION | ( | Struct | , |
| llzk__component | ) |
Get reference to the LLZK struct dialect.