[LoopVectorizer] Propagate underlying instruction to the cloned instances of VPPartia...
[llvm-project.git] / flang / tools / fir-opt / fir-opt.cpp
blobef510ff77ad253d14e4ffcd4b8bb94a8eb68dc8f
1 //===- fir-opt.cpp - FIR Optimizer Driver -----------------------*- C++ -*-===//
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 to be like LLVM's opt program, only for FIR. Such a program is
10 // required for roundtrip testing, etc.
12 //===----------------------------------------------------------------------===//
14 #include "mlir/Tools/mlir-opt/MlirOptMain.h"
15 #include "flang/Optimizer/CodeGen/CodeGen.h"
16 #include "flang/Optimizer/HLFIR/Passes.h"
17 #include "flang/Optimizer/OpenMP/Passes.h"
18 #include "flang/Optimizer/Support/InitFIR.h"
19 #include "flang/Optimizer/Transforms/Passes.h"
21 using namespace mlir;
22 namespace fir {
23 namespace test {
24 void registerTestFIRAliasAnalysisPass();
25 void registerTestFIROpenACCInterfacesPass();
26 } // namespace test
27 } // namespace fir
29 // Defined in mlir/test, no pulic header.
30 namespace mlir {
31 void registerSideEffectTestPasses();
34 int main(int argc, char **argv) {
35 fir::support::registerMLIRPassesForFortranTools();
36 fir::registerOptCodeGenPasses();
37 fir::registerOptTransformPasses();
38 hlfir::registerHLFIRPasses();
39 flangomp::registerFlangOpenMPPasses();
40 #ifdef FLANG_INCLUDE_TESTS
41 fir::test::registerTestFIRAliasAnalysisPass();
42 fir::test::registerTestFIROpenACCInterfacesPass();
43 mlir::registerSideEffectTestPasses();
44 #endif
45 DialectRegistry registry;
46 fir::support::registerDialects(registry);
47 registry.insert<mlir::gpu::GPUDialect>();
48 registry.insert<mlir::NVVM::NVVMDialect>();
49 fir::support::addFIRExtensions(registry);
50 return failed(MlirOptMain(argc, argv, "FIR modular optimizer driver\n",
51 registry));