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               "llvm::cl::ZeroOrMore, llvm::cl::MiscFlags::CommaSeparated">,
25  ];
26}
27
28def ReductionTree : Pass<"reduction-tree"> {
29  let summary = "Reduce the input with reduction-tree algorithm";
30
31  let constructor = "mlir::createReductionTreePass()";
32
33  let options = [
34    Option<"traversalModeId", "traversal-mode", "unsigned",
35           /* default */"0",
36           "The graph traversal mode, the default is single-path mode">,
37  ] # CommonReductionPassOptions.options;
38}
39
40def OptReduction : Pass<"opt-reduction-pass", "ModuleOp"> {
41  let summary = "A wrapper pass that reduces the file with optimization passes";
42
43  let constructor = "mlir::createOptReductionPass()";
44
45  let options = [
46    Option<"optPass", "opt-pass", "std::string", /* default */"",
47           "The optimization passes used for reduction, e.g., symbol-dce">,
48  ] # CommonReductionPassOptions.options;
49}
50
51#endif // MLIR_REDUCER_PASSES
52