xref: /llvm-project/mlir/examples/minimal-opt/mlir-minimal-opt-canonicalize.cpp (revision e7f8b459532de54a8606c7d387ded7ccf5108cb5)
1 //===- mlir-minimal-opt-canonicalize.cpp ------------------------*- C++ -*-===//
2 //
3 // This file is licensed 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 #include "mlir/Tools/mlir-opt/MlirOptMain.h"
10 #include "mlir/Transforms/Passes.h"
11 
main(int argc,char ** argv)12 int main(int argc, char **argv) {
13   // Register only the canonicalize pass
14   // This pulls in the pattern rewrite engine as well as the whole PDL
15   // compiler/intepreter.
16   mlir::registerCanonicalizerPass();
17 
18   mlir::DialectRegistry registry;
19   return mlir::asMainReturnCode(mlir::MlirOptMain(
20       argc, argv, "Minimal Standalone optimizer driver\n", registry));
21 }
22