LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Function.h
Go to the documentation of this file.
1//===-- Function.h - C API for Function dialect -------------------*- C -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9//
10// This header declares the C interface for registering and accessing the
11// Function dialect. A dialect should be registered with a context to make it
12// available to users of the context. These users must load the dialect
13// before using any of its attributes, operations, or types. Parser and pass
14// manager can load registered dialects automatically.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLZK_C_DIALECT_FUNCTION_H
19#define LLZK_C_DIALECT_FUNCTION_H
20
21#include "llzk-c/Support.h"
22
23#include <mlir-c/IR.h>
24#include <mlir-c/Support.h>
25
26#include <stdint.h>
27
28// Include the generated CAPI
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
38
39//===----------------------------------------------------------------------===//
40// FuncDefOp
41//===----------------------------------------------------------------------===//
42
46 Function, FuncDefOp, WithAttrsAndArgAttrs, MlirStringRef name, MlirType type, intptr_t nAttrs,
47 MlirNamedAttribute const *attrs, intptr_t nArgAttrs, MlirAttribute const *argAttrs
48);
49
52 Function, FuncDefOp, WithAttrs, MlirStringRef name, MlirType type, intptr_t nAttrs,
53 MlirNamedAttribute const *attrs
54);
55
59 Function, FuncDefOp, WithArgAttrs, MlirStringRef name, MlirType type, intptr_t nArgAttrs,
60 MlirAttribute const *argAttrs
61);
62
65 Function, FuncDefOp, WithoutAttrs, MlirStringRef name, MlirType type
66);
67
70MLIR_CAPI_EXPORTED MlirAttribute
71llzkFunction_FuncDefOpGetArgNameAttr(MlirOperation op, unsigned index);
72
77MLIR_CAPI_EXPORTED void
78llzkFunction_FuncDefOpSetArgNameAttr(MlirOperation op, unsigned index, MlirAttribute attr);
79
83MLIR_CAPI_EXPORTED void
84llzkFunction_FuncDefOpSetArgName(MlirOperation op, unsigned index, MlirStringRef name);
85
88MLIR_CAPI_EXPORTED MlirAttribute
89llzkFunction_FuncDefOpGetResNameAttr(MlirOperation op, unsigned index);
90
95MLIR_CAPI_EXPORTED void
96llzkFunction_FuncDefOpSetResNameAttr(MlirOperation op, unsigned index, MlirAttribute attr);
97
101MLIR_CAPI_EXPORTED void
102llzkFunction_FuncDefOpSetResName(MlirOperation op, unsigned index, MlirStringRef name);
103
104//===----------------------------------------------------------------------===//
105// CallOp
106//===----------------------------------------------------------------------===//
107
110 Function, CallOp, intptr_t numResults, MlirType const *results, MlirAttribute name,
111 intptr_t numOperands, MlirValue const *operands
112);
113
116 Function, CallOp, ToCallee, MlirOperation callee, intptr_t numOperands,
117 MlirValue const *operands
118);
119
122 Function, CallOp, WithMapOperands, intptr_t numResults, MlirType const *results,
123 MlirAttribute name, LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands,
124 MlirValue const *argOperands
125);
126
129 Function, CallOp, ToCalleeWithMapOperands, MlirOperation callee,
130 LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands, MlirValue const *argOperands
131);
132
135 Function, CallOp, WithTemplateParams, intptr_t numResults, MlirType const *results,
136 MlirAttribute name, intptr_t numTemplateParams, MlirAttribute const *templateParams,
137 intptr_t numArgOperands, MlirValue const *argOperands
138);
139
142 Function, CallOp, ToCalleeWithTemplateParams, MlirOperation callee, intptr_t numTemplateParams,
143 MlirAttribute const *templateParams, intptr_t numArgOperands, MlirValue const *argOperands
144);
145
146#ifdef __cplusplus
147}
148#endif
149
150#endif // LLZK_C_DIALECT_FUNCTION_H
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.
Definition Function.cpp:102
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.
Definition Function.cpp:111
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Function, llzk__function)
Get reference to the LLZK function dialect.
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.
Definition Function.cpp:115
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...
Definition Function.cpp:106
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...
Definition Function.cpp:93
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.
Definition Function.cpp:98
#define LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD(dialect, op, suffix,...)
Definition Support.h:33
#define LLZK_DECLARE_OP_BUILD_METHOD(dialect, op,...)
Definition Support.h:38
Encapsulates the arguments related to affine maps that are common in operation constructors that supp...
Definition Support.h:103