LLZK 3.0.0
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.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, FuncDefOp, WithAttrsAndArgAttrs, MlirStringRef name, MlirType type, intptr_t nAttrs, MlirNamedAttribute const *attrs, intptr_t nArgAttrs, MlirAttribute const *argAttrs)
 Builds a FuncDefOp with the given attributes and argument attributes.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, FuncDefOp, WithAttrs, MlirStringRef name, MlirType type, intptr_t nAttrs, MlirNamedAttribute const *attrs)
 Builds a FuncDefOp with the given attributes.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, FuncDefOp, WithArgAttrs, MlirStringRef name, MlirType type, intptr_t nArgAttrs, MlirAttribute const *argAttrs)
 Builds a FuncDefOp with the given argument attributes.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Function, FuncDefOp, WithoutAttrs, MlirStringRef name, MlirType type)
 Builds a FuncDefOp.
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.
MLIR_CAPI_EXPORTED MlirAttribute llzkFunction_FuncDefOpGetResNameAttr (MlirOperation op, unsigned index)
 Returns the function.res_name StringAttr for the result at the given index, or null if the result has no function.res_name attribute.
MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetResNameAttr (MlirOperation op, unsigned index, MlirAttribute attr)
 Sets the function.res_name attribute for the result at the given index.
MLIR_CAPI_EXPORTED void llzkFunction_FuncDefOpSetResName (MlirOperation op, unsigned index, MlirStringRef name)
 Sets the function.res_name attribute for the result 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/9]

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/9]

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/9]

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/9]

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/9]

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() [6/9]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
FuncDefOp ,
WithArgAttrs ,
MlirStringRef name,
MlirType type,
intptr_t nArgAttrs,
MlirAttribute const * argAttrs )

Builds a FuncDefOp with the given argument attributes.

Each argument attribute must be a DictionaryAttr.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [7/9]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
FuncDefOp ,
WithAttrs ,
MlirStringRef name,
MlirType type,
intptr_t nAttrs,
MlirNamedAttribute const * attrs )

Builds a FuncDefOp with the given attributes.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [8/9]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
FuncDefOp ,
WithAttrsAndArgAttrs ,
MlirStringRef name,
MlirType type,
intptr_t nAttrs,
MlirNamedAttribute const * attrs,
intptr_t nArgAttrs,
MlirAttribute const * argAttrs )

Builds a FuncDefOp with the given attributes and argument attributes.

Each argument attribute must be a DictionaryAttr.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [9/9]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Function ,
FuncDefOp ,
WithoutAttrs ,
MlirStringRef name,
MlirType type )

Builds a FuncDefOp.

◆ 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 93 of file Function.cpp.

◆ llzkFunction_FuncDefOpGetResNameAttr()

MLIR_CAPI_EXPORTED MlirAttribute llzkFunction_FuncDefOpGetResNameAttr ( MlirOperation op,
unsigned index )

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

Definition at line 106 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 102 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 98 of file Function.cpp.

◆ llzkFunction_FuncDefOpSetResName()

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

Sets the function.res_name attribute for the result at the given index from a string value.

Empty and duplicate names are rejected by the FuncDefOp verifier.

Definition at line 115 of file Function.cpp.

◆ llzkFunction_FuncDefOpSetResNameAttr()

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

Sets the function.res_name attribute for the result at the given index.

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

Definition at line 111 of file Function.cpp.

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( Function ,
llzk__function  )

Get reference to the LLZK function dialect.