1//===-- TransformationPasses.td ------------------------*- tablegen -*-===//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_POLYMORPHIC_TRANSFORMATION_PASSES_TD
11#define LLZK_POLYMORPHIC_TRANSFORMATION_PASSES_TD
13include "llzk/Pass/PassBase.td"
15def EmptyParamListRemovalPass : LLZKPass<"llzk-drop-empty-params"> {
16 let summary = "Remove empty struct parameter lists";
17 let constructor = "llzk::polymorphic::createEmptyParamListRemoval()";
20def FlatteningPass : LLZKPass<"llzk-flatten"> {
21 let summary = "Flatten structs and unroll loops";
23 Performs the following transformations:
24 - Instantiate `affine_map` parameters of StructType and ArrayType
25 to constant values using the arguments at the instantiation site
26 - Replace parameterized structs with flattened (i.e. no parameter)
27 versions of those structs based on requested return type at calls
28 to `compute()` functions and unroll loops
31 let constructor = "llzk::polymorphic::createFlatteningPass()";
34#endif // LLZK_POLYMORPHIC_TRANSFORMATION_PASSES_TD