LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
LLZKComputeConstrainToProductPass.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <mlir/Support/LogicalResult.h>
8
9#include <vector>
10
11namespace llzk {
12
14 mlir::SymbolTableCollection &tables;
16
17public:
18 std::vector<component::StructDefOp> alignedStructs;
20 mlir::SymbolTableCollection &_tables, LightweightSignalEquivalenceAnalysis &_equivalence
21 )
22 : tables {_tables}, equivalence {_equivalence} {}
23
24 // Given a @product function body, try to match up calls to @A::@compute and @A::@constrain for
25 // every sub-struct @A and replace them with a call to @A::@product
26 mlir::LogicalResult alignCalls(function::FuncDefOp product);
27
28 // Given a StructDefOp @root, replace the @root::@compute and @root::@constrain functions with a
29 // @root::@product
32 );
33};
34
35mlir::LogicalResult alignStartingAt(
36 component::StructDefOp root, mlir::SymbolTableCollection &tables,
38);
39
40} // namespace llzk
std::vector< component::StructDefOp > alignedStructs
ProductAligner(mlir::SymbolTableCollection &_tables, LightweightSignalEquivalenceAnalysis &_equivalence)
function::FuncDefOp alignFuncs(component::StructDefOp root, function::FuncDefOp compute, function::FuncDefOp constrain)
mlir::LogicalResult alignCalls(function::FuncDefOp product)
LogicalResult alignStartingAt(component::StructDefOp root, SymbolTableCollection &tables, LightweightSignalEquivalenceAnalysis &equivalence)