LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Function.h File Reference
#include "llzk-c/Support.h"
#include <mlir-c/IR.h>
#include <mlir-c/Support.h>
#include <stdint.h>
#include "llzk/Dialect/Function/IR/Attrs.capi.h.inc"
#include "llzk/Dialect/Function/IR/Ops.capi.h.inc"
Include dependency graph for Function.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (Function, llzk__function)
 Get reference to the LLZK function dialect.
MLIR_CAPI_EXPORTED MlirOperation llzkFunction_FuncDefOpCreateWithAttrsAndArgAttrs (MlirLocation loc, MlirStringRef name, MlirType type, intptr_t nAttrs, MlirNamedAttribute const *attrs, intptr_t nArgAttrs, MlirAttribute const *argAttrs)
 Creates a FuncDefOp with the given attributes and argument attributes.
MLIR_CAPI_EXPORTED bool llzkFunction_FuncDefOpHasArgNameAttr (MlirOperation op, unsigned index)
 Returns true iff the argument at the given index has a function.arg_name attribute.
MLIR_CAPI_EXPORTED MlirAttribute llzkFunction_FuncDefOpGetArgNameAttr (MlirOperation op, unsigned index)
 Returns the function.arg_name StringAttr for the argument at the given index, or null if the argument has no function.arg_name attribute.
MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetArgNameAttr (MlirOperation op, unsigned index, MlirAttribute attr)
 Sets the function.arg_name attribute for the argument at the given index.
MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetArgName (MlirOperation op, unsigned index, MlirStringRef name)
 Sets the function.arg_name attribute for the argument at the given index from a string value.
 LLZK_DECLARE_OP_BUILD_METHOD (Function, CallOp, intptr_t numResults, MlirType const *results, MlirAttribute name, intptr_t numOperands, MlirValue const *operands)
 Creates a CallOp.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCallee, MlirOperation callee, intptr_t numOperands, MlirValue const *operands)
 Creates a CallOp targeting the given FuncDefOp.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, WithMapOperands, intptr_t numResults, MlirType const *results, MlirAttribute name, LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands, MlirValue const *argOperands)
 Creates a CallOp with affine map operands.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCalleeWithMapOperands, MlirOperation callee, LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands, MlirValue const *argOperands)
 Creates a CallOp targeting the given FuncDefOp with affine map operands.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, WithTemplateParams, intptr_t numResults, MlirType const *results, MlirAttribute name, intptr_t numTemplateParams, MlirAttribute const *templateParams, intptr_t numArgOperands, MlirValue const *argOperands)
 Creates a CallOp with templateParams attributes.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCalleeWithTemplateParams, MlirOperation callee, intptr_t numTemplateParams, MlirAttribute const *templateParams, intptr_t numArgOperands, MlirValue const *argOperands)
 Creates a CallOp targeting the given FuncDefOp with templateParams attributes.

Function Documentation

◆ LLZK_DECLARE_OP_BUILD_METHOD()

LLZK_DECLARE_OP_BUILD_METHOD ( Function ,
CallOp ,
intptr_t numResults,
MlirType const * results,
MlirAttribute name,
intptr_t numOperands,
MlirValue const * operands )

Creates a CallOp.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [1/5]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
CallOp ,
ToCallee ,
MlirOperation callee,
intptr_t numOperands,
MlirValue const * operands )

Creates a CallOp targeting the given FuncDefOp.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [2/5]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
CallOp ,
ToCalleeWithMapOperands ,
MlirOperation callee,
LlzkAffineMapOperandsBuilder mapOperands,
intptr_t numArgOperands,
MlirValue const * argOperands )

Creates a CallOp targeting the given FuncDefOp with affine map operands.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [3/5]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
CallOp ,
ToCalleeWithTemplateParams ,
MlirOperation callee,
intptr_t numTemplateParams,
MlirAttribute const * templateParams,
intptr_t numArgOperands,
MlirValue const * argOperands )

Creates a CallOp targeting the given FuncDefOp with templateParams attributes.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [4/5]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
CallOp ,
WithMapOperands ,
intptr_t numResults,
MlirType const * results,
MlirAttribute name,
LlzkAffineMapOperandsBuilder mapOperands,
intptr_t numArgOperands,
MlirValue const * argOperands )

Creates a CallOp with affine map operands.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [5/5]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
CallOp ,
WithTemplateParams ,
intptr_t numResults,
MlirType const * results,
MlirAttribute name,
intptr_t numTemplateParams,
MlirAttribute const * templateParams,
intptr_t numArgOperands,
MlirValue const * argOperands )

Creates a CallOp with templateParams attributes.

◆ llzkFunction_FuncDefOpCreateWithAttrsAndArgAttrs()

MLIR_CAPI_EXPORTED MlirOperation llzkFunction_FuncDefOpCreateWithAttrsAndArgAttrs ( MlirLocation location,
MlirStringRef name,
MlirType funcType,
intptr_t numAttrs,
MlirNamedAttribute const * attrs,
intptr_t numArgAttrs,
MlirAttribute const * argAttrs )

Creates a FuncDefOp with the given attributes and argument attributes.

Each argument attribute has to be a DictionaryAttr.

Definition at line 48 of file Function.cpp.

◆ llzkFunction_FuncDefOpGetArgNameAttr()

MLIR_CAPI_EXPORTED MlirAttribute llzkFunction_FuncDefOpGetArgNameAttr ( MlirOperation op,
unsigned index )

Returns the function.arg_name StringAttr for the argument at the given index, or null if the argument has no function.arg_name attribute.

Definition at line 70 of file Function.cpp.

◆ llzkFunction_FuncDefOpHasArgNameAttr()

MLIR_CAPI_EXPORTED bool llzkFunction_FuncDefOpHasArgNameAttr ( MlirOperation op,
unsigned index )

Returns true iff the argument at the given index has a function.arg_name attribute.

Definition at line 66 of file Function.cpp.

◆ llzkFunction_FuncDefOpSetArgName()

MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetArgName ( MlirOperation op,
unsigned index,
MlirStringRef name )

Sets the function.arg_name attribute for the argument at the given index from a string value.

Empty and duplicate names are rejected by the FuncDefOp verifier.

Definition at line 79 of file Function.cpp.

◆ llzkFunction_FuncDefOpSetArgNameAttr()

MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetArgNameAttr ( MlirOperation op,
unsigned index,
MlirAttribute attr )

Sets the function.arg_name attribute for the argument at the given index.

The attribute must be a StringAttr. Empty and duplicate names are rejected by the FuncDefOp verifier.

Definition at line 75 of file Function.cpp.

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( Function ,
llzk__function  )

Get reference to the LLZK function dialect.