|
LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
|
#include "llzk/CAPI/Support.h"#include "llzk-c/Support.h"#include "llzk/Util/Compare.h"#include "llzk/Util/SymbolLookup.h"#include <mlir-c/BuiltinAttributes.h>#include <mlir/CAPI/IR.h>#include <mlir/CAPI/Support.h>#include <mlir/CAPI/Wrap.h>#include <mlir/IR/BuiltinAttributes.h>#include <mlir/IR/Iterators.h>#include <mlir/IR/SymbolTable.h>#include <cstdint>#include <cstring>Go to the source code of this file.
Functions | |
| void | llzkSymbolLookupResultDestroy (LlzkSymbolLookupResult result) |
| Destroys the lookup result, releasing its resources. | |
| MlirOperation | LlzkSymbolLookupResultGetOperation (LlzkSymbolLookupResult wrapped) |
| Returns the looked up Operation. | |
| void | mlirOperationReplaceUsesOfWith (MlirOperation op, MlirValue oldValue, MlirValue newValue) |
| Note: Duplicated from upstream LLVM. Available in 21.1.8 and later. | |
| void | mlirOperationWalkReverse (MlirOperation from, MlirOperationWalkCallback callback, void *userData, MlirWalkOrder walkOrder) |
| Walks operation op in walkOrder, with operations at the same nesting level traversed in reverse order, and calls callback on that operation. | |
| void | llzkSymbolTableInsert (MlirOperation symTableOp, MlirOperation newSymbolOp) |
| Inserts newSymbolOp into the symbol table owned by symTableOp. | |
| LlzkAffineMapOperandsBuilder | llzkAffineMapOperandsBuilderCreate () |
| Creates a new struct. The owner is responsible for cleaning the struct. | |
| void | llzkAffineMapOperandsBuilderDestroy (LlzkAffineMapOperandsBuilder *builder) |
| Destroys the struct releasing its resources. | |
| void | llzkAffineMapOperandsBuilderAppendOperands (LlzkAffineMapOperandsBuilder *builder, intptr_t n, MlirValueRange const *mapOperands) |
| Appends the value ranges to the list of map operands. | |
| void | llzkAffineMapOperandsBuilderAppendOperandsWithDimCount (LlzkAffineMapOperandsBuilder *builder, intptr_t n, MlirValueRange const *mapOperands, int32_t const *dimsPerMap) |
| Appends the value ranges to the list of map operands and indicates how many of these operands are dimensions. | |
| void | llzkAffineMapOperandsBuilderAppendDimCount (LlzkAffineMapOperandsBuilder *builder, intptr_t n, int32_t const *dimsPerMap) |
| Appends a dimension count to the list of dimensions per map. | |
| void | llzkAffineMapOperandsBuilderSetDimsPerMapFromAttr (LlzkAffineMapOperandsBuilder *builder, MlirAttribute attribute) |
| Sets the number of dimensions per map to the given attribute. | |
| void | llzkAffineMapOperandsBuilderConvertDimsPerMapToArray (LlzkAffineMapOperandsBuilder *builder) |
| Converts the list of dimensions defined as an attribute into an array. | |
| void | llzkAffineMapOperandsBuilderConvertDimsPerMapToAttr (LlzkAffineMapOperandsBuilder *builder, MlirContext context) |
| Converts the list of dimensions defined as an array into an attribute. | |
| MlirAttribute | llzkAffineMapOperandsBuilderGetDimsPerMapAttr (LlzkAffineMapOperandsBuilder builder, MlirContext context) |
| Returns the number of dimensions per map represented as an attribute. | |
| void llzkAffineMapOperandsBuilderAppendDimCount | ( | LlzkAffineMapOperandsBuilder * | builder, |
| intptr_t | n, | ||
| int32_t const * | dimsPerMap ) |
Appends a dimension count to the list of dimensions per map.
If the builder is in Attr mode allocates an array with enough space and copies the attr's contents into it before appending the new value.
Definition at line 160 of file Support.cpp.
| void llzkAffineMapOperandsBuilderAppendOperands | ( | LlzkAffineMapOperandsBuilder * | builder, |
| intptr_t | n, | ||
| MlirValueRange const * | mapOperands ) |
Appends the value ranges to the list of map operands.
Definition at line 144 of file Support.cpp.
| void llzkAffineMapOperandsBuilderAppendOperandsWithDimCount | ( | LlzkAffineMapOperandsBuilder * | builder, |
| intptr_t | n, | ||
| MlirValueRange const * | mapOperands, | ||
| int32_t const * | dimsPerMap ) |
Appends the value ranges to the list of map operands and indicates how many of these operands are dimensions.
Asserts that the number of map operands and the number of dimensions per map is the same to avoid going out of sync.
Definition at line 150 of file Support.cpp.
| void llzkAffineMapOperandsBuilderConvertDimsPerMapToArray | ( | LlzkAffineMapOperandsBuilder * | builder | ) |
Converts the list of dimensions defined as an attribute into an array.
This function is a no-op if the list was already in array mode.
Definition at line 176 of file Support.cpp.
| void llzkAffineMapOperandsBuilderConvertDimsPerMapToAttr | ( | LlzkAffineMapOperandsBuilder * | builder, |
| MlirContext | context ) |
Converts the list of dimensions defined as an array into an attribute.
This function is a no-op if the list was already in attribute mode.
Definition at line 187 of file Support.cpp.
| LlzkAffineMapOperandsBuilder llzkAffineMapOperandsBuilderCreate | ( | void | ) |
Creates a new struct. The owner is responsible for cleaning the struct.
Definition at line 122 of file Support.cpp.
| void llzkAffineMapOperandsBuilderDestroy | ( | LlzkAffineMapOperandsBuilder * | builder | ) |
Destroys the struct releasing its resources.
Definition at line 132 of file Support.cpp.
| MlirAttribute llzkAffineMapOperandsBuilderGetDimsPerMapAttr | ( | LlzkAffineMapOperandsBuilder | builder, |
| MlirContext | context ) |
Returns the number of dimensions per map represented as an attribute.
Definition at line 195 of file Support.cpp.
| void llzkAffineMapOperandsBuilderSetDimsPerMapFromAttr | ( | LlzkAffineMapOperandsBuilder * | builder, |
| MlirAttribute | attribute ) |
Sets the number of dimensions per map to the given attribute.
Overwrites the previous values and deallocates if necessary.
Asserts that the attribute is of type DenseI32ArrayAttr.
Definition at line 167 of file Support.cpp.
| void llzkSymbolLookupResultDestroy | ( | LlzkSymbolLookupResult | result | ) |
Destroys the lookup result, releasing its resources.
Definition at line 33 of file Support.cpp.
| MlirOperation LlzkSymbolLookupResultGetOperation | ( | LlzkSymbolLookupResult | wrapped | ) |
Returns the looked up Operation.
The lifetime of the Operation is tied to the lifetime of the lookup result.
Definition at line 40 of file Support.cpp.
| void llzkSymbolTableInsert | ( | MlirOperation | symTableOp, |
| MlirOperation | newSymbolOp ) |
Inserts newSymbolOp into the symbol table owned by symTableOp.
Insertion via the SymbolTable automatically renames symTableOp if necessary to avoid name collisions.
Requires that symTableOp implements the SymbolTable op interface and that newSymbolOp has a sym_name attribute.
Definition at line 81 of file Support.cpp.
| void mlirOperationReplaceUsesOfWith | ( | MlirOperation | op, |
| MlirValue | oldValue, | ||
| MlirValue | newValue ) |
Note: Duplicated from upstream LLVM. Available in 21.1.8 and later.
Replace uses of 'of' value with the 'with' value inside the 'op' operation.
Definition at line 46 of file Support.cpp.
| void mlirOperationWalkReverse | ( | MlirOperation | from, |
| MlirOperationWalkCallback | callback, | ||
| void * | userData, | ||
| MlirWalkOrder | walkOrder ) |
Walks operation op in walkOrder, with operations at the same nesting level traversed in reverse order, and calls callback on that operation.
*userData is passed to the callback as well and can be used to tunnel some context or other data into the callback.
Definition at line 65 of file Support.cpp.