LLZK
3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Toggle main menu visibility
Loading...
Searching...
No Matches
LLZKLoweringUtils.h
Go to the documentation of this file.
1
//===-- LLZKLoweringUtils.h -------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLZK Project, under the Apache License v2.0.
4
// See LICENSE.txt for license information.
5
// Copyright 2026 Project LLZK
6
// SPDX-License-Identifier: Apache-2.0
7
//
8
//===----------------------------------------------------------------------===//
13
//===----------------------------------------------------------------------===//
14
15
#pragma once
16
17
#include "
llzk/Dialect/Constrain/IR/Ops.h
"
18
#include "
llzk/Dialect/Felt/IR/Ops.h
"
19
#include "
llzk/Dialect/Function/IR/Ops.h
"
20
21
#include <mlir/IR/Builders.h>
22
#include <mlir/IR/BuiltinOps.h>
23
#include <mlir/IR/Types.h>
24
#include <mlir/IR/Value.h>
25
#include <mlir/Support/LogicalResult.h>
26
27
#include <llvm/ADT/DenseMap.h>
28
29
namespace
llzk
{
30
31
struct
AuxAssignment
{
32
std::string
auxMemberName
;
33
mlir::Value
computedValue
;
34
};
35
41
mlir::Value
rebuildExprInCompute
(
42
mlir::Value val,
function::FuncDefOp
computeFunc, mlir::OpBuilder &builder,
43
llvm::DenseMap<mlir::Value, mlir::Value> &memo
44
);
45
46
mlir::LogicalResult
47
checkForAuxMemberConflicts
(
component::StructDefOp
structDef, llvm::StringRef auxPrefix);
48
53
mlir::LogicalResult
checkFuncBodyIsStraightLine
(
function::FuncDefOp
func, llvm::StringRef passName);
54
55
component::MemberDefOp
56
addAuxMember
(
component::StructDefOp
structDef, llvm::StringRef name, mlir::Type type);
57
58
unsigned
getFeltDegree
(mlir::Value val, llvm::DenseMap<mlir::Value, unsigned> &memo);
59
74
void
replaceSubsequentUsesWith
(mlir::Value oldVal, mlir::Value newVal, mlir::Operation *afterOp);
75
76
}
// namespace llzk
Ops.h
Ops.h
Ops.h
llzk::component::MemberDefOp
Definition
Ops.h.inc:307
llzk::component::StructDefOp
Definition
Ops.h.inc:1148
llzk::function::FuncDefOp
Definition
Ops.h.inc:633
llzk
Definition
AnalysisPassEnums.cpp:19
llzk::rebuildExprInCompute
Value rebuildExprInCompute(Value val, FuncDefOp computeFunc, OpBuilder &builder, DenseMap< Value, Value > &memo)
Definition
LLZKLoweringUtils.cpp:65
llzk::replaceSubsequentUsesWith
void replaceSubsequentUsesWith(Value oldVal, Value newVal, Operation *afterOp)
Definition
LLZKLoweringUtils.cpp:268
llzk::addAuxMember
MemberDefOp addAuxMember(StructDefOp structDef, StringRef name, Type type)
Definition
LLZKLoweringUtils.cpp:287
llzk::checkFuncBodyIsStraightLine
LogicalResult checkFuncBodyIsStraightLine(FuncDefOp func, StringRef passName)
Definition
LLZKLoweringUtils.cpp:239
llzk::getFeltDegree
unsigned getFeltDegree(Value val, DenseMap< Value, unsigned > &memo)
Definition
LLZKLoweringUtils.cpp:295
llzk::checkForAuxMemberConflicts
LogicalResult checkForAuxMemberConflicts(StructDefOp structDef, StringRef prefix)
Definition
LLZKLoweringUtils.cpp:227
llzk::AuxAssignment
Definition
LLZKLoweringUtils.h:31
llzk::AuxAssignment::computedValue
mlir::Value computedValue
Definition
LLZKLoweringUtils.h:33
llzk::AuxAssignment::auxMemberName
std::string auxMemberName
Definition
LLZKLoweringUtils.h:32
include
llzk
Transforms
LLZKLoweringUtils.h
Generated by
1.17.0
Copyright 2025 Veridise Inc. under the Apache License v2.0. Copyright 2026 Project LLZK under the Apache License v2.0.