[AMDGPU][True16][CodeGen] true16 codegen pattern for f16 canonicalize (#122000)
[llvm-project.git] / mlir / examples / transform / Ch2 / transform-opt / transform-opt.cpp
blob874ad78c7e837781ff0d55595040164cad10e83d
1 //===-- transform-opt.cpp - Transform dialect tutorial entry point --------===//
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 is the top-level file for the Transform dialect tutorial chapter 2.
11 //===----------------------------------------------------------------------===//
13 #include "MyExtension.h"
15 #include "mlir/Dialect/Transform/Transforms/Passes.h"
16 #include "mlir/IR/DialectRegistry.h"
17 #include "mlir/IR/MLIRContext.h"
18 #include "mlir/InitAllDialects.h"
19 #include "mlir/InitAllExtensions.h"
20 #include "mlir/Tools/mlir-opt/MlirOptMain.h"
21 #include "mlir/Transforms/Passes.h"
22 #include <cstdlib>
24 namespace test {
25 void registerTestTransformDialectExtension(mlir::DialectRegistry &);
26 } // namespace test
28 int main(int argc, char **argv) {
29 // Register all "core" dialects and our transform dialect extension.
30 mlir::DialectRegistry registry;
31 mlir::registerAllDialects(registry);
32 mlir::registerAllExtensions(registry);
33 registerMyExtension(registry);
35 // Register transform interpreter pass.
36 mlir::transform::registerInterpreterPass();
38 // Register a handful of cleanup passes that we can run to make the output IR
39 // look nicer.
40 mlir::registerCanonicalizerPass();
41 mlir::registerCSEPass();
42 mlir::registerSymbolDCEPass();
44 // Delegate to the MLIR utility for parsing and pass management.
45 return mlir::MlirOptMain(argc, argv, "transform-opt-ch2", registry)
46 .succeeded()
47 ? EXIT_SUCCESS
48 : EXIT_FAILURE;