[flang-commits] [flang] af186e9 - Revert "[flang][fir] Add fir-opt tool"
via flang-commits
flang-commits at lists.llvm.org
Fri Feb 12 19:28:09 PST 2021
Author: clementval
Date: 2021-02-12T22:27:48-05:00
New Revision: af186e93723837a507042acf1d7338e125706129
URL: https://github.com/llvm/llvm-project/commit/af186e93723837a507042acf1d7338e125706129
DIFF: https://github.com/llvm/llvm-project/commit/af186e93723837a507042acf1d7338e125706129.diff
LOG: Revert "[flang][fir] Add fir-opt tool"
This reverts commit df1eeaa7b404f7c5a96a812479f0ee2ce8354f6a.
Buildbot failure.
Added:
Modified:
flang/test/CMakeLists.txt
flang/test/Fir/fir-ops.fir
flang/test/Fir/fir-types.fir
flang/tools/CMakeLists.txt
Removed:
flang/tools/fir-opt/CMakeLists.txt
flang/tools/fir-opt/fir-opt.cpp
################################################################################
diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt
index 7328afc7ba02..abda950e1d3e 100644
--- a/flang/test/CMakeLists.txt
+++ b/flang/test/CMakeLists.txt
@@ -34,7 +34,7 @@ set(FLANG_TEST_PARAMS
flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
set(FLANG_TEST_DEPENDS
- f18 FileCheck count not module_files fir-opt
+ f18 FileCheck count not module_files
)
list(APPEND FLANG_TEST_DEPENDS tco)
diff --git a/flang/test/Fir/fir-ops.fir b/flang/test/Fir/fir-ops.fir
index 58b679cb2934..4a1f21ae7544 100644
--- a/flang/test/Fir/fir-ops.fir
+++ b/flang/test/Fir/fir-ops.fir
@@ -1,6 +1,6 @@
// Test the FIR operations
-// Parse operations and check that we can reparse what we print.
-// RUN: fir-opt %s | fir-opt | FileCheck %s
+
+// RUN: tco -emit-fir %s | tco -emit-fir | FileCheck %s
// CHECK-LABEL: func private @it1() -> !fir.int<4>
// CHECK: func private @box1() -> !fir.boxchar<2>
diff --git a/flang/test/Fir/fir-types.fir b/flang/test/Fir/fir-types.fir
index d9f46e9f0a03..2a46301b0b4c 100644
--- a/flang/test/Fir/fir-types.fir
+++ b/flang/test/Fir/fir-types.fir
@@ -1,6 +1,6 @@
// Test the FIR types
-// Parse types and check that we can reparse what we print.
-// RUN: fir-opt %s | fir-opt | FileCheck %s
+
+// RUN: tco -emit-fir %s | tco -emit-fir | FileCheck %s
// Fortran Intrinsic types
// CHECK-LABEL: func private @it1() -> !fir.int<4>
diff --git a/flang/tools/CMakeLists.txt b/flang/tools/CMakeLists.txt
index 98b20a1ff358..ecce72771172 100644
--- a/flang/tools/CMakeLists.txt
+++ b/flang/tools/CMakeLists.txt
@@ -12,4 +12,3 @@ if(FLANG_BUILD_NEW_DRIVER)
endif()
add_subdirectory(tco)
add_subdirectory(f18-parse-demo)
-add_subdirectory(fir-opt)
diff --git a/flang/tools/fir-opt/CMakeLists.txt b/flang/tools/fir-opt/CMakeLists.txt
deleted file mode 100644
index efd33f9826b9..000000000000
--- a/flang/tools/fir-opt/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-add_flang_tool(fir-opt fir-opt.cpp)
-llvm_update_compile_flags(fir-opt)
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-
-target_link_libraries(fir-opt PRIVATE
- FIROptimizer
- ${dialect_libs}
-
- # TODO: these should be transitive dependencies from a target providing
- # "registerFIRPasses()"
- MLIRAffineToStandard
- MLIROptLib
-)
diff --git a/flang/tools/fir-opt/fir-opt.cpp b/flang/tools/fir-opt/fir-opt.cpp
deleted file mode 100644
index fc6c04ec2320..000000000000
--- a/flang/tools/fir-opt/fir-opt.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===- fir-opt.cpp - FIR Optimizer Driver -----------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This is to be like LLVM's opt program, only for FIR. Such a program is
-// required for roundtrip testing, etc.
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Support/MlirOptMain.h"
-#include "flang/Optimizer/Dialect/FIRDialect.h"
-
-using namespace mlir;
-
-int main(int argc, char **argv) {
- fir::registerFIRPasses();
- DialectRegistry registry;
- fir::registerFIRDialects(registry);
- return failed(MlirOptMain(argc, argv, "FIR modular optimizer driver\n",
- registry, /*preloadDialectsInContext*/ false));
-}
More information about the flang-commits
mailing list