1 //===- mlir-reduce.cpp - The MLIR reducer ---------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the general framework of the MLIR reducer tool. It
10 // parses the command line arguments, parses the initial MLIR test case and sets
11 // up the testing environment. It outputs the most reduced test case variant
12 // after executing the reduction passes.
14 //===----------------------------------------------------------------------===//
16 #include "mlir/IR/Dialect.h"
17 #include "mlir/IR/MLIRContext.h"
18 #include "mlir/InitAllDialects.h"
19 #include "mlir/InitAllPasses.h"
20 #include "mlir/Tools/mlir-reduce/MlirReduceMain.h"
25 #ifdef MLIR_INCLUDE_TESTS
26 void registerTestDialect(DialectRegistry
&);
30 int main(int argc
, char **argv
) {
33 DialectRegistry registry
;
34 registerAllDialects(registry
);
35 #ifdef MLIR_INCLUDE_TESTS
36 test::registerTestDialect(registry
);
38 MLIRContext
context(registry
);
40 return failed(mlirReduceMain(argc
, argv
, context
));