LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
TransformationPasses.td
Go to the documentation of this file.
1//===-- TransformationPasses.td ----------------------------*- tablegen -*-===//
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#ifndef LLZK_POD_TRANSFORMATION_PASSES_TD
11#define LLZK_POD_TRANSFORMATION_PASSES_TD
12
13include "llzk/Pass/PassBase.td"
14
15def PodToScalarPass : LLZKPass<"llzk-pod-to-scalar"> {
16 let summary = "Replace PODs with scalar values";
17 let description = [{
18 Scalarize `pod.type` values by splitting POD-typed struct members into
19 multiple scalar members, splitting POD-typed array elements into parallel
20 arrays, then rewriting affected member accesses plus function signatures,
21 calls, and returns, and finally running POD-specific SROA + mem2reg cleanup
22 so the remaining POD storage is promoted to SSA values.
23
24 If it is necessary to scalarize both PODs and arrays, run this pass before
25 running the `-llzk-array-to-scalar` pass because that pass will not scalarize
26 array types that are within a POD type.
27 }];
28}
29
30#endif // LLZK_POD_TRANSFORMATION_PASSES_TD