LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Attrs.td
Go to the documentation of this file.
1//===-- Attrs.td -------------------------------------------*- tablegen -*-===//
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#ifndef LLZK_FUNCTION_ATTRS
11#define LLZK_FUNCTION_ATTRS
12
13include "llzk/Dialect/Function/IR/Dialect.td"
14include "llzk/Dialect/Function/IR/Attrs.td" // must be included to generate docs
15
16include "mlir/IR/AttrTypeBase.td"
17
18class FunctionDialectAttr<string name, string attrMnemonic,
19 list<Trait> traits = []>
20 : AttrDef<FunctionDialect, name, traits> {
21 let mnemonic = attrMnemonic;
22}
23
24def LLZK_AllowConstraintAttr
25 : FunctionDialectAttr<"AllowConstraint", "allow_constraint"> {
26 let summary =
27 "Marks functions to allow `ConstraintGen` ops within their body";
28 let description = [{
29 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops
30 marked with `ConstraintGen` (e.g., emit ops) are allowed within its body.
31 }];
32}
33
34def LLZK_AllowWitnessAttr
35 : FunctionDialectAttr<"AllowWitness", "allow_witness"> {
36 let summary = "Marks functions to allow `WitnessGen` ops within their body";
37 let description = [{
38 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
39 with `WitnessGen` (e.g., construct and write ops) are allowed within its body.
40 }];
41}
42
43def LLZK_AllowNonNativeFieldOpsAttr
44 : FunctionDialectAttr<"AllowNonNativeFieldOps",
45 "allow_non_native_field_ops"> {
46 let summary =
47 "Marks functions to allow `NotFieldNative` ops within their body";
48 let description = [{
49 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
50 with `NotFieldNative` (e.g., boolean and bitwise ops) are allowed within its body.
51 }];
52}
53
54#endif // LLZK_FUNCTION_ATTRS