[Infra] Fix version-check workflow (#100090)
[llvm-project.git] / mlir / tools / mlir-reduce / mlir-reduce.cpp
blob44b21b805e8c3e2255de3278ced6033da3f631b1
1 //===- mlir-reduce.cpp - The MLIR reducer ---------------------------------===//
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 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"
22 using namespace mlir;
24 namespace test {
25 #ifdef MLIR_INCLUDE_TESTS
26 void registerTestDialect(DialectRegistry &);
27 #endif
28 } // namespace test
30 int main(int argc, char **argv) {
31 registerAllPasses();
33 DialectRegistry registry;
34 registerAllDialects(registry);
35 #ifdef MLIR_INCLUDE_TESTS
36 test::registerTestDialect(registry);
37 #endif
38 MLIRContext context(registry);
40 return failed(mlirReduceMain(argc, argv, context));