xref: /llvm-project/mlir/include/mlir/Reducer/Passes.td (revision 039b969b32b64b64123dce30dd28ec4e343d893f)
1//===-- Passes.td - MLIR Reduce pass definition file -------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains definitions of the passes for the MLIR Reduce Tool.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_REDUCER_PASSES
14#define MLIR_REDUCER_PASSES
15
16include "mlir/Pass/PassBase.td"
17
18def CommonReductionPassOptions {
19  list<Option> options = [
20    Option<"testerName", "test", "std::string", /* default */"",
21           "The location of the tester which tests the file interestingness">,
22    ListOption<"testerArgs", "test-arg", "std::string",
23               "arguments of the tester">,
24  ];
25}
26
27def ReductionTree : Pass<"reduction-tree"> {
28  let summary = "Reduce the input with reduction-tree algorithm";
29
30  let constructor = "mlir::createReductionTreePass()";
31
32  let options = [
33    Option<"traversalModeId", "traversal-mode", "unsigned",
34           /* default */"0",
35           "The graph traversal mode, the default is single-path mode">,
36  ] # CommonReductionPassOptions.options;
37}
38
39def OptReduction : Pass<"opt-reduction-pass", "ModuleOp"> {
40  let summary = "A wrapper pass that reduces the file with optimization passes";
41
42  let constructor = "mlir::createOptReductionPass()";
43
44  let options = [
45    Option<"optPass", "opt-pass", "std::string", /* default */"",
46           "The optimization passes used for reduction, e.g., symbol-dce">,
47  ] # CommonReductionPassOptions.options;
48}
49
50#endif // MLIR_REDUCER_PASSES
51