LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.h
Go to the documentation of this file.
1//===-- Ops.h ---------------------------------------------------*- 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#pragma once
11
16#include "llzk/Util/Constants.h"
18
19#include <mlir/IR/OpImplementation.h>
20#include <mlir/Interfaces/CallInterfaces.h>
21#include <mlir/Interfaces/ControlFlowInterfaces.h>
22#include <mlir/Interfaces/FunctionInterfaces.h>
23
24#include <cstdint>
25#include <optional>
26
27// Include TableGen'd declarations
28#define GET_OP_CLASSES
30
31namespace llzk::function {
32
34constexpr char ARG_NAME_ATTR_NAME[] = "function.arg_name";
35
37constexpr char RES_NAME_ATTR_NAME[] = "function.res_name";
38
50
57FunctionKind fnNameToKind(mlir::StringRef name);
58
59} // namespace llzk::function
constexpr char ARG_NAME_ATTR_NAME[]
Attribute name for source-level function argument names.
Definition Ops.h:34
constexpr char RES_NAME_ATTR_NAME[]
Attribute name for source-level function result names.
Definition Ops.h:37
FunctionKind fnNameToKind(mlir::StringRef name)
Given a function name, return the corresponding FunctionKind.
Definition Ops.cpp:52
FunctionKind
Kinds of functions in LLZK.
Definition Ops.h:40
@ StructConstrain
Function within a struct named FUNC_NAME_CONSTRAIN.
Definition Ops.h:44
@ StructProduct
Function within a struct named FUNC_NAME_PRODUCT.
Definition Ops.h:46
@ StructCompute
Function within a struct named FUNC_NAME_COMPUTE.
Definition Ops.h:42
@ Free
Function that is not within a struct.
Definition Ops.h:48