|
LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
|
This file implements the -llzk-pod-to-scalar pass. More...
#include "llzk/Dialect/Array/IR/Dialect.h"#include "llzk/Dialect/Array/IR/Ops.h"#include "llzk/Dialect/Array/IR/Types.h"#include "llzk/Dialect/Bool/IR/Dialect.h"#include "llzk/Dialect/Bool/IR/Ops.h"#include "llzk/Dialect/Bool/Transforms/TransformationPasses.h"#include "llzk/Dialect/Cast/IR/Dialect.h"#include "llzk/Dialect/Constrain/IR/Dialect.h"#include "llzk/Dialect/Constrain/IR/Ops.h"#include "llzk/Dialect/Felt/IR/Dialect.h"#include "llzk/Dialect/Function/IR/Dialect.h"#include "llzk/Dialect/Function/IR/Ops.h"#include "llzk/Dialect/Include/IR/Dialect.h"#include "llzk/Dialect/LLZK/IR/Dialect.h"#include "llzk/Dialect/LLZK/IR/Ops.h"#include "llzk/Dialect/POD/IR/Dialect.h"#include "llzk/Dialect/POD/IR/Ops.h"#include "llzk/Dialect/POD/IR/Types.h"#include "llzk/Dialect/POD/Transforms/TransformationPasses.h"#include "llzk/Dialect/Polymorphic/IR/Dialect.h"#include "llzk/Dialect/Polymorphic/IR/Ops.h"#include "llzk/Dialect/Polymorphic/Transforms/TransformationPasses.h"#include "llzk/Dialect/RAM/IR/Dialect.h"#include "llzk/Dialect/String/IR/Dialect.h"#include "llzk/Dialect/Struct/IR/Ops.h"#include "llzk/Transforms/LLZKConversionUtils.h"#include "llzk/Transforms/LLZKTransformationPasses.h"#include "llzk/Transforms/SpecializedMemoryPasses.h"#include "llzk/Util/Concepts.h"#include "llzk/Util/TypeHelper.h"#include "llzk/Util/Walk.h"#include <mlir/Dialect/SCF/IR/SCF.h>#include <mlir/Dialect/SCF/Transforms/Patterns.h>#include <mlir/Pass/PassManager.h>#include <mlir/Transforms/DialectConversion.h>#include <mlir/Transforms/GreedyPatternRewriteDriver.h>#include <mlir/Transforms/Passes.h>#include <llvm/ADT/DenseMapInfo.h>#include <llvm/ADT/STLExtras.h>#include <llvm/ADT/TypeSwitch.h>#include <llvm/Support/Debug.h>#include <llvm/Support/raw_ostream.h>#include <functional>#include <limits>#include <optional>#include "llzk/Dialect/POD/Transforms/TransformationPasses.h.inc"Go to the source code of this file.
Classes | |
| class | llzk::pod::impl::PodToScalarPassBase< DerivedT > |
| struct | llvm::DenseMapInfo< RecordChain > |
| struct | llvm::DenseMapInfo< CompatiblePodLeafMaterializationKey > |
Namespaces | |
| namespace | llzk |
| namespace | llzk::pod |
| namespace | llzk::pod::impl |
| namespace | llvm |
Macros | |
| #define | GEN_PASS_DEF_PODTOSCALARPASS |
| #define | DEBUG_TYPE "llzk-pod-to-scalar" |
Functions | |
| std::unique_ptr<::mlir::Pass > | llzk::pod::impl::createPodToScalarPass () |
| std::unique_ptr<::mlir::Pass > | llzk::pod::createPodToScalarPass () |
This file implements the -llzk-pod-to-scalar pass.
The steps of this transformation are as follows:
Steps 5-7 are rerun while nested POD types are still being exposed, until a fixpoint.
Note: This transformation imposes a "last write wins" semantics on pod records. If different/configurable semantics are added in the future, some additional transformation would be necessary before/during this pass so that multiple writes to the same record can be handled properly while they still exist.
Note: This transformation will introduce a nondet op when there exists a read from a pod record that was not earlier written to.
Terminology: A "virtual POD" is a POD-typed placeholder whose contents are represented by SSA values for each flattened leaf record rather than by explicit pod.write operations on an aggregate POD object. The pass uses virtual PODs to keep propagating scalar leaves through rewrites for as long as possible because that avoids re-introducing aggregate POD storage that later stages would need to split or promote again. Concrete POD storage is materialized only when some remaining use cannot be resolved from those leaf values directly.
Definition in file PodToScalarPass.cpp.
| #define DEBUG_TYPE "llzk-pod-to-scalar" |
Definition at line 137 of file PodToScalarPass.cpp.
| #define GEN_PASS_DEF_PODTOSCALARPASS |
Definition at line 125 of file PodToScalarPass.cpp.