1//===-- LLZKTransformationPasses.td ------------------------*- tablegen -*-===//
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
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_TRANSFORMATION_PASSES_TD
11#define LLZK_TRANSFORMATION_PASSES_TD
13include "llzk/Pass/PassBase.td"
15def RedundantReadAndWriteEliminationPass
16 : LLZKPass<"llzk-duplicate-read-write-elim"> {
17 let summary = "Remove redundant reads and writes";
19 Remove read and write operations to struct fields and arrays that are redundant or unnecessary.
21 let constructor = "llzk::createRedundantReadAndWriteEliminationPass()";
24def RedundantOperationEliminationPass : LLZKPass<"llzk-duplicate-op-elim"> {
25 let summary = "Remove redundant operations";
27 Remove llzk and arith dialect operations that produce the same results
28 as previously executed operations.
30 Pass should be run after llzk-duplicate-read-write-elim for maximum effect.
32 let constructor = "llzk::createRedundantOperationEliminationPass()";
35def UnusedDeclarationEliminationPass
36 : LLZKPass<"llzk-unused-declaration-elim"> {
37 let summary = "Remove unused field and struct declarations";
39 Remove field and struct declarations that are unused within the current compilation
40 unit. Note that this pass may cause linking issues with external modules that
41 depend on any unused field and struct declarations from this compilation unit.
43 Pass should be run after llzk-duplicate-read-write-elim
44 and llzk-duplicate-op-elim for maximum effect.
46 let constructor = "llzk::createUnusedDeclarationEliminationPass()";
47 let options = [Option<"removeStructs", "remove-structs", "bool",
48 /* default */ "false",
49 "Whether to remove unused struct definitions as well. "
50 "Requires module to declare a Main component, "
51 "otherwise all components will appear unused.">,
56 : LLZKPass<"llzk-poly-lowering-pass"> {
57 let summary = "Lowers the degree of all polynomial equations to a specified maximum";
59 Rewrites constraint expressions into an (observationally) equivalent system where the degree of every polynomial
60 is less than or equal to the specified maximum.
62 This pass is best used as part of the `-llzk-full-poly-lowering` pipeline, which includes
63 additional cleanup passes to ensure correctness and optimal performance.
65 let constructor = "llzk::createPolyLoweringPass()";
66 let options = [Option<"maxDegree", "max-degree", "unsigned",
68 "Maximum degree of constraint polynomials "
69 "(default 2, minimum 2)">,
73#endif // LLZK_TRANSFORMATION_PASSES_TD