LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Function.cpp File Reference
#include "llzk-c/Dialect/Function.h"
#include "llzk-c/Support.h"
#include "llzk/CAPI/Builder.h"
#include "llzk/CAPI/Support.h"
#include "llzk/Dialect/Function/IR/Dialect.h"
#include "llzk/Dialect/Function/IR/Ops.h"
#include <mlir-c/BuiltinAttributes.h>
#include <mlir-c/IR.h>
#include <mlir-c/Pass.h>
#include <mlir/CAPI/IR.h>
#include <mlir/CAPI/Pass.h>
#include <mlir/CAPI/Registration.h>
#include <mlir/CAPI/Wrap.h>
#include <mlir/IR/Attributes.h>
#include <mlir/IR/BuiltinAttributes.h>
#include <llvm/ADT/SmallVectorExtras.h>
#include "llzk/Dialect/Function/IR/Attrs.capi.cpp.inc"
#include "llzk/Dialect/Function/IR/Ops.capi.cpp.inc"
Include dependency graph for Function.cpp:

Go to the source code of this file.

Functions

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.
bool llzkFunction_FuncDefOpHasArgNameAttr (MlirOperation op, unsigned index)
 Returns true iff the argument at the given index has a function.arg_name attribute.
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.
void llzkFunction_FuncDefOpSetArgNameAttr (MlirOperation op, unsigned index, MlirAttribute attr)
 Sets the function.arg_name attribute for the argument at the given index.
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_DEFINE_OP_BUILD_METHOD (Function, CallOp, intptr_t numResults, MlirType const *results, MlirAttribute name, intptr_t numOperands, MlirValue const *operands)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCallee, MlirOperation callee, intptr_t numOperands, MlirValue const *operands)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, WithMapOperands, intptr_t numResults, MlirType const *results, MlirAttribute name, LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands, MlirValue const *argOperands)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCalleeWithMapOperands, MlirOperation callee, LlzkAffineMapOperandsBuilder mapOperands, intptr_t numArgOperands, MlirValue const *argOperands)
 LLZK_DEFINE_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)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Function, CallOp, ToCalleeWithTemplateParams, MlirOperation callee, intptr_t numTemplateParams, MlirAttribute const *templateParams, intptr_t numArgOperands, MlirValue const *argOperands)

Function Documentation

◆ LLZK_DEFINE_OP_BUILD_METHOD()

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

Definition at line 93 of file Function.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [1/5]

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

Definition at line 107 of file Function.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [2/5]

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

Definition at line 138 of file Function.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [3/5]

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

Definition at line 171 of file Function.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [4/5]

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

Definition at line 119 of file Function.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [5/5]

LLZK_DEFINE_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 )

Definition at line 154 of file Function.cpp.

◆ llzkFunction_FuncDefOpCreateWithAttrsAndArgAttrs()

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()

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()

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()

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()

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.