LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
OpTraits.td
Go to the documentation of this file.
1//===-- OpTraits.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_TRAITS
11#define LLZK_FUNCTION_TRAITS
12
13include "mlir/IR/OpBase.td"
14
15/// Marker for ops that are specific to witness generation. Op classes with
16/// this trait are valid only in functions that have the `AllowWitnessAttr`.
17def WitnessGen : NativeOpTrait<"WitnessGen">, StructuralOpTrait {
18 string cppNamespace = "::llzk::function";
19}
20
21/// Marker for ops that are specific to constraint generation. Op classes with
22/// this trait are valid only in functions that have the `AllowConstraintAttr`.
23def ConstraintGen : NativeOpTrait<"ConstraintGen">, StructuralOpTrait {
24 string cppNamespace = "::llzk::function";
25}
26
27/// Marker for ops over `llzk.felt` type operands that are not native to finite
28/// field arithmetic and thus must be rewritten or folded into a constant after
29/// the flattening and unrolling pass. Op classes with this trait are valid only
30/// in functions that have the `AllowNonNativeFieldOpsAttr`.
31def NotFieldNative : NativeOpTrait<"NotFieldNative">, StructuralOpTrait {
32 string cppNamespace = "::llzk::function";
33}
34
35#endif // LLZK_FUNCTION_TRAITS