LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
LLZKComputeConstrainToProductPass.h
Go to the documentation of this file.
1//===-- LLZKComputeConstrainToProductPass.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
15
16#include <mlir/Support/LogicalResult.h>
17
18#include <vector>
19
20namespace llzk {
21
23 mlir::SymbolTableCollection &tables;
25
26public:
27 std::vector<component::StructDefOp> alignedStructs;
29 mlir::SymbolTableCollection &_tables, LightweightSignalEquivalenceAnalysis &_equivalence
30 )
31 : tables {_tables}, equivalence {_equivalence} {}
32
33 // Given a @product function body, try to match up calls to @A::@compute and @A::@constrain for
34 // every sub-struct @A and replace them with a call to @A::@product
35 mlir::LogicalResult alignCalls(function::FuncDefOp product);
36
37 // Given a StructDefOp @root, replace the @root::@compute and @root::@constrain functions with a
38 // @root::@product
41 );
42};
43
44} // namespace llzk
std::vector< component::StructDefOp > alignedStructs
function::FuncDefOp alignFuncs(component::StructDefOp root, function::FuncDefOp compute, function::FuncDefOp constrain)
ProductAligner(mlir::SymbolTableCollection &_tables, LightweightSignalEquivalenceAnalysis &_equivalence)
mlir::LogicalResult alignCalls(function::FuncDefOp product)