LLZK
3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Toggle main menu visibility
Loading...
Searching...
No Matches
LLZKLayout.h
Go to the documentation of this file.
1
//===-- LLZKLayout.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
//===----------------------------------------------------------------------===//
9
10
#pragma once
11
12
#include <mlir/IR/BuiltinAttributes.h>
13
#include <mlir/IR/BuiltinOps.h>
14
#include <mlir/Support/LogicalResult.h>
15
16
#include <llvm/ADT/DenseMap.h>
17
#include <llvm/ADT/SmallVector.h>
18
19
#include <cstdint>
20
#include <optional>
21
22
namespace
llvm
{
23
class
raw_ostream;
24
}
// namespace llvm
25
26
namespace
llzk
{
27
29
inline
constexpr
char
LAYOUT_MAIN_ROOT
[] =
"main"
;
31
inline
constexpr
char
LAYOUT_ARGUMENT_ROOT
[] =
"arg"
;
32
45
struct
LLZKLayout
{
47
llvm::SmallVector<mlir::ArrayAttr>
signalPaths
;
49
llvm::DenseMap<mlir::ArrayAttr, uint64_t>
signalIds
;
52
llvm::SmallVector<mlir::StringAttr>
argumentNames
;
53
56
std::optional<uint64_t>
getSignalId
(mlir::ArrayAttr path)
const
;
57
};
58
68
mlir::FailureOr<LLZKLayout>
buildLLZKLayout
(mlir::ModuleOp module);
69
72
void
printLLZKLayout
(
const
LLZKLayout
&layout, llvm::raw_ostream &output);
73
74
}
// namespace llzk
llvm
Definition
SourceRefLattice.cpp:411
llzk
Definition
AnalysisPassEnums.cpp:19
llzk::printLLZKLayout
void printLLZKLayout(const LLZKLayout &layout, llvm::raw_ostream &output)
Print the logical signal section of the .llzk-layout format.
Definition
LLZKLayout.cpp:315
llzk::buildLLZKLayout
mlir::FailureOr< LLZKLayout > buildLLZKLayout(mlir::ModuleOp module)
Enumerate the signal leaves of llzk.main and its constrain arguments.
llzk::LAYOUT_ARGUMENT_ROOT
constexpr char LAYOUT_ARGUMENT_ROOT[]
Structural path root for a constrain argument, followed by its position.
Definition
LLZKLayout.h:31
llzk::LAYOUT_MAIN_ROOT
constexpr char LAYOUT_MAIN_ROOT[]
Structural path root for storage in the main instance.
Definition
LLZKLayout.h:29
llzk::LLZKLayout
Logical felt-signal paths in a monomorphized LLZK circuit.
Definition
LLZKLayout.h:45
llzk::LLZKLayout::signalPaths
llvm::SmallVector< mlir::ArrayAttr > signalPaths
Structural paths indexed by logical signal ID.
Definition
LLZKLayout.h:47
llzk::LLZKLayout::argumentNames
llvm::SmallVector< mlir::StringAttr > argumentNames
Optional display names indexed by constrain argument position.
Definition
LLZKLayout.h:52
llzk::LLZKLayout::getSignalId
std::optional< uint64_t > getSignalId(mlir::ArrayAttr path) const
Look up a structural path in this layout.
Definition
LLZKLayout.cpp:304
llzk::LLZKLayout::signalIds
llvm::DenseMap< mlir::ArrayAttr, uint64_t > signalIds
Reverse mapping from structural storage paths to logical signal IDs.
Definition
LLZKLayout.h:49
include
llzk
Util
LLZKLayout.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.