From openmp-commits at lists.llvm.org Tue Oct 1 08:46:42 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Tue, 01 Oct 2024 08:46:42 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fc1962.050a0220.846e5.1e34@mx.google.com> everythingfunctional wrote: > Shouldn't `-fopenacc` then also emit such a warning? Well, we could get into a philosophical discussion about whether software is ever *not* experimental. But in this case I think it's fine to be a bit proactive and warn users that we know there are still some unfinished aspects. Or we could maybe use the word "incomplete" instead of experimental. Either way I'm happy to add the warning for both, just let me know. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Tue Oct 1 10:10:48 2024 From: openmp-commits at lists.llvm.org (Valentin Clement =?utf-8?b?44OQ44Os44Oz44K/44Kk44OzIOOCr+ODrOODoeODsw==?= via Openmp-commits) Date: Tue, 01 Oct 2024 10:10:48 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fc2d18.170a0220.3babad.e63f@mx.google.com> clementval wrote: > > Could you add an experimental message ("The openmp support in Flang is experimental") when compiling with OpenMP? The warning can be in the Driver code that forwards the `-fopenmp` flag to the driver. > > Hm. I'm not yet fully convinced that we should be doing this. Shouldn't `-fopenacc` then also emit such a warning? OpenACC has no codegen upstream yet so it will never produce an executable. When we start adding support for codeine/runtime, a warning is probably nice until good enough support is reached. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Tue Oct 1 14:38:49 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Tue, 01 Oct 2024 14:38:49 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fc6be9.630a0220.776f2.5007@mx.google.com> everythingfunctional wrote: Sounds like I should just add the warning to OpenMP for now. I'll work on getting that added and then figure out why the CI is failing. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 2 08:17:41 2024 From: openmp-commits at lists.llvm.org (Joel E. Denny via Openmp-commits) Date: Wed, 02 Oct 2024 08:17:41 -0700 (PDT) Subject: [Openmp-commits] [clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365) In-Reply-To: Message-ID: <66fd6415.170a0220.59042.3dbe@mx.google.com> ================ @@ -1,12 +1,17 @@ -// RUN: %libomptarget-compile-generic -fprofile-instr-generate \ -// RUN: -Xclang "-fprofile-instrument=clang" -// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic \ -// RUN: --check-prefix="CLANG-PGO" // RUN: %libomptarget-compile-generic -fprofile-generate \ // RUN: -Xclang "-fprofile-instrument=llvm" -// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic \ +// RUN: env LLVM_PROFILE_FILE=llvm.profraw %libomptarget-run-generic 2>&1 +// RUN: llvm-profdata show --all-functions --counts \ ---------------- jdenny-ornl wrote: We should probably have a substitution that locates the llvm-profdata from the build. On a test system I use, the above instead picks up rocm's llvm-profdata and reports: ``` error: amdgcn-amd-amdhsa.llvm.profraw: unsupported instrumentation profile format version ``` https://github.com/llvm/llvm-project/pull/93365 From openmp-commits at lists.llvm.org Wed Oct 2 08:41:21 2024 From: openmp-commits at lists.llvm.org (Joel E. Denny via Openmp-commits) Date: Wed, 02 Oct 2024 08:41:21 -0700 (PDT) Subject: [Openmp-commits] [clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Add GPU profiling flags to driver (PR #94268) In-Reply-To: Message-ID: <66fd69a1.170a0220.ae5fe.731b@mx.google.com> ================ @@ -0,0 +1,82 @@ +// RUN: %libomptarget-compile-generic -fprofile-generate-gpu ---------------- jdenny-ornl wrote: When targeting a V100, this command fails for me in both pgo1.c and pgo2.c. In the LTO case: ``` LLVM ERROR: Circular dependency found in global variable set ``` In the non-LTO case: ``` fatal error: error in backend: NVPTX aliasee must be a non-kernel function definition ``` I do not see this problem in PR #93365's pgo1.c. https://github.com/llvm/llvm-project/pull/94268 From openmp-commits at lists.llvm.org Wed Oct 2 08:43:32 2024 From: openmp-commits at lists.llvm.org (Joseph Huber via Openmp-commits) Date: Wed, 02 Oct 2024 08:43:32 -0700 (PDT) Subject: [Openmp-commits] [clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Add GPU profiling flags to driver (PR #94268) In-Reply-To: Message-ID: <66fd6a24.a70a0220.1d18df.ab40@mx.google.com> ================ @@ -0,0 +1,82 @@ +// RUN: %libomptarget-compile-generic -fprofile-generate-gpu ---------------- jhuber6 wrote: This is a limitation of the PTX target, globals cannot reference themselves. Most likely whatever NVIDIA engineer wrote the PTX parser found it annoying to reference something that wasn't fully parsed yet so he just decided to make it an error and here we are. See https://godbolt.org/z/53PP5c5ve. https://github.com/llvm/llvm-project/pull/94268 From openmp-commits at lists.llvm.org Wed Oct 2 09:51:56 2024 From: openmp-commits at lists.llvm.org (Baodi Shan via Openmp-commits) Date: Wed, 02 Oct 2024 09:51:56 -0700 (PDT) Subject: [Openmp-commits] [openmp] Add 'offload' in OpenMP target doc. (PR #110141) In-Reply-To: Message-ID: <66fd7a2c.170a0220.ba28b.7f50@mx.google.com> lwshanbd wrote: @shiltian https://github.com/llvm/llvm-project/pull/110141 From openmp-commits at lists.llvm.org Wed Oct 2 09:55:16 2024 From: openmp-commits at lists.llvm.org (Shilei Tian via Openmp-commits) Date: Wed, 02 Oct 2024 09:55:16 -0700 (PDT) Subject: [Openmp-commits] [openmp] Add 'offload' in OpenMP target doc. (PR #110141) In-Reply-To: Message-ID: <66fd7af4.170a0220.20aec3.4fab@mx.google.com> https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/110141 From openmp-commits at lists.llvm.org Wed Oct 2 09:55:27 2024 From: openmp-commits at lists.llvm.org (Shilei Tian via Openmp-commits) Date: Wed, 02 Oct 2024 09:55:27 -0700 (PDT) Subject: [Openmp-commits] [openmp] [Offload][Doc] Add 'offload' in OpenMP target doc (PR #110141) In-Reply-To: Message-ID: <66fd7aff.170a0220.3cb298.7934@mx.google.com> https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/110141 From openmp-commits at lists.llvm.org Wed Oct 2 09:55:32 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Wed, 02 Oct 2024 09:55:32 -0700 (PDT) Subject: [Openmp-commits] [openmp] 4123050 - [Offload][Doc] Add 'offload' in OpenMP target doc (#110141) Message-ID: <66fd7b04.050a0220.3406d2.b0d1@mx.google.com> Author: Baodi Shan Date: 2024-10-02T12:55:28-04:00 New Revision: 4123050b965f685e8e56c74d413e99f64f35d38b URL: https://github.com/llvm/llvm-project/commit/4123050b965f685e8e56c74d413e99f64f35d38b DIFF: https://github.com/llvm/llvm-project/commit/4123050b965f685e8e56c74d413e99f64f35d38b.diff LOG: [Offload][Doc] Add 'offload' in OpenMP target doc (#110141) Fix #106399 Added: Modified: openmp/docs/SupportAndFAQ.rst Removed: ################################################################################ diff --git a/openmp/docs/SupportAndFAQ.rst b/openmp/docs/SupportAndFAQ.rst index cd2d6a47032214..dee707cf50f919 100644 --- a/openmp/docs/SupportAndFAQ.rst +++ b/openmp/docs/SupportAndFAQ.rst @@ -52,7 +52,7 @@ All patches go through the regular `LLVM review process Q: How to build an OpenMP GPU offload capable compiler? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To build an *effective* OpenMP offload capable compiler, only one extra CMake -option, ``LLVM_ENABLE_RUNTIMES="openmp"``, is needed when building LLVM (Generic +option, ``LLVM_ENABLE_RUNTIMES="openmp;offload"``, is needed when building LLVM (Generic information about building LLVM is available `here `__.). Make sure all backends that are targeted by OpenMP are enabled. That can be done by adjusting the CMake From openmp-commits at lists.llvm.org Wed Oct 2 09:55:33 2024 From: openmp-commits at lists.llvm.org (Shilei Tian via Openmp-commits) Date: Wed, 02 Oct 2024 09:55:33 -0700 (PDT) Subject: [Openmp-commits] [openmp] [Offload][Doc] Add 'offload' in OpenMP target doc (PR #110141) In-Reply-To: Message-ID: <66fd7b05.170a0220.92224.4c88@mx.google.com> https://github.com/shiltian closed https://github.com/llvm/llvm-project/pull/110141 From openmp-commits at lists.llvm.org Wed Oct 2 10:13:12 2024 From: openmp-commits at lists.llvm.org (Leandro Lupori via Openmp-commits) Date: Wed, 02 Oct 2024 10:13:12 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fd7f28.050a0220.20bfe.bd3f@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- luporl wrote: ```suggestion (and CMake 3.24.0), `cmake` can detect `flang` as a ``` Can CMake already detect `flang` as well? https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 2 11:01:36 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Wed, 02 Oct 2024 11:01:36 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fd8a80.050a0220.297bd2.cdb2@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- everythingfunctional wrote: That I am not quite sure of. I will look into it and adjust that comment in the docs as appropriate. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 2 11:25:11 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Wed, 02 Oct 2024 11:25:11 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fd9007.050a0220.291356.be12@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- everythingfunctional wrote: @banach-space appears to have been involved in that MR, do you happen to know the answer to the above questions? It looks like it doesn't rely on the `flang-new` name, but I'm not sure. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 2 11:45:06 2024 From: openmp-commits at lists.llvm.org (=?UTF-8?Q?H=C3=A5kon_Strandenes?= via Openmp-commits) Date: Wed, 02 Oct 2024 11:45:06 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fd94b2.170a0220.37fa11.6555@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- hakostra wrote: 1. A search in the CMake repository revel that `flang-new` only appear in testcases and ci-related code - not in any code that eventually end up in CMake. This indicate that the name `flang-new` is not a magic token for CMake to recognize LLVM Flang. 2. I think that [this is the merge](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) that first introduced LLVM Flang to CMake. It seems like the check is through preprocessor macros defined by the different compilers. See [`Modules/CMakeFortranCompilerId.F.in`](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/CMakeFortranCompilerId.F.in) in the CMake sources. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 2 13:58:09 2024 From: openmp-commits at lists.llvm.org (=?UTF-8?Q?Andrzej_Warzy=C5=84ski?= via Openmp-commits) Date: Wed, 02 Oct 2024 13:58:09 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fdb3e1.050a0220.25e621.e9b3@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- banach-space wrote: > It seems like the check is through preprocessor macros defined by the different compilers. Yes, thank you @hakostra πŸ™πŸ» https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 3 04:58:58 2024 From: openmp-commits at lists.llvm.org (David Truby via Openmp-commits) Date: Thu, 03 Oct 2024 04:58:58 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fe8702.170a0220.393cc6.3f58@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- DavidTruby wrote: Just to add, for an actually working CMake with flang-new that detects the correct options and does the right thing reliably, you'll need CMake 3.28 as that's the first version with fully working flang-new support, so if updating this comment could you change 3.24 to 3.28 as well? I am fairly sure the CMake support for LLVM flang is designed to work fine regardless of the name of the binary, as the CMake devs were anticipating this name change anyway. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 3 14:12:59 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Thu, 03 Oct 2024 14:12:59 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66ff08db.050a0220.f40f1.96ca@mx.google.com> https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From 649a73478c78389560042030a9717a05e8e338a8 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/4] [flang][driver] rename flang-new to flang --- .github/workflows/release-binaries.yml | 2 +- clang/include/clang/Driver/Options.td | 4 +- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Driver/ToolChains/Flang.cpp | 6 +- clang/test/Driver/flang/flang.f90 | 2 +- clang/test/Driver/flang/flang_ucase.F90 | 2 +- .../Driver/flang/multiple-inputs-mixed.f90 | 2 +- clang/test/Driver/flang/multiple-inputs.f90 | 4 +- flang/docs/FlangDriver.md | 76 +++++++++---------- flang/docs/ImplementingASemanticCheck.md | 4 +- flang/docs/Overview.md | 26 +++---- .../FlangOmpReport/FlangOmpReport.cpp | 2 +- .../flang/Optimizer/Analysis/AliasAnalysis.h | 2 +- flang/include/flang/Tools/CrossToolHelpers.h | 2 +- flang/lib/Frontend/CompilerInvocation.cpp | 6 +- flang/lib/Frontend/FrontendActions.cpp | 2 +- .../ExecuteCompilerInvocation.cpp | 3 +- flang/runtime/CMakeLists.txt | 6 +- flang/test/CMakeLists.txt | 2 +- flang/test/Driver/aarch64-outline-atomics.f90 | 2 +- .../Driver/color-diagnostics-forwarding.f90 | 4 +- flang/test/Driver/compiler-options.f90 | 4 +- flang/test/Driver/convert.f90 | 2 +- .../test/Driver/disable-ext-name-interop.f90 | 2 +- flang/test/Driver/driver-version.f90 | 4 +- flang/test/Driver/escaped-backslash.f90 | 4 +- flang/test/Driver/fdefault.f90 | 28 +++---- flang/test/Driver/flarge-sizes.f90 | 20 ++--- .../test/Driver/frame-pointer-forwarding.f90 | 2 +- flang/test/Driver/frontend-forwarding.f90 | 4 +- flang/test/Driver/hlfir-no-hlfir-error.f90 | 4 +- flang/test/Driver/intrinsic-module-path.f90 | 2 +- flang/test/Driver/large-data-threshold.f90 | 6 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/macro-def-undef.F90 | 4 +- flang/test/Driver/missing-input.f90 | 14 ++-- flang/test/Driver/multiple-input-files.f90 | 2 +- flang/test/Driver/omp-driver-offload.f90 | 66 ++++++++-------- .../predefined-macros-compiler-version.F90 | 4 +- flang/test/Driver/std2018-wrong.f90 | 2 +- flang/test/Driver/std2018.f90 | 2 +- .../Driver/supported-suffices/f03-suffix.f03 | 2 +- .../Driver/supported-suffices/f08-suffix.f08 | 2 +- flang/test/Driver/use-module-error.f90 | 4 +- flang/test/Driver/use-module.f90 | 4 +- flang/test/Driver/version-loops.f90 | 18 ++--- flang/test/Driver/wextra-ok.f90 | 2 +- flang/test/HLFIR/hlfir-flags.f90 | 2 +- .../Intrinsics/command_argument_count.f90 | 4 +- flang/test/Lower/Intrinsics/exit.f90 | 2 +- .../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +- flang/test/Lower/Intrinsics/isnan.f90 | 2 +- flang/test/Lower/Intrinsics/modulo.f90 | 2 +- .../OpenMP/Todo/omp-declarative-allocate.f90 | 2 +- .../OpenMP/Todo/omp-declare-reduction.f90 | 2 +- .../Lower/OpenMP/Todo/omp-declare-simd.f90 | 2 +- .../parallel-lastprivate-clause-scalar.f90 | 2 +- .../parallel-wsloop-reduction-byref.f90 | 2 +- .../OpenMP/parallel-wsloop-reduction.f90 | 2 +- flang/test/lit.cfg.py | 4 +- flang/tools/f18/CMakeLists.txt | 10 +-- flang/tools/flang-driver/CMakeLists.txt | 12 +-- flang/tools/flang-driver/driver.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 10 +-- offload/CMakeLists.txt | 4 +- openmp/CMakeLists.txt | 4 +- 66 files changed, 220 insertions(+), 227 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 925912df6843e4..6073ebac9e6c2c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -328,7 +328,7 @@ jobs: run: | # Build some of the mlir tools that take a long time to link if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc fi ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \ mlir-bytecode-parser-fuzzer \ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 932cf13edab53d..4a45a825da8fa1 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6071,7 +6071,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; //===----------------------------------------------------------------------===// -// pie/pic options (clang + flang-new) +// pie/pic options (clang + flang) //===----------------------------------------------------------------------===// let Visibility = [ClangOption, FlangOption] in { @@ -6087,7 +6087,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group; } // let Vis = [Default, FlangOption] //===----------------------------------------------------------------------===// -// Target Options (clang + flang-new) +// Target Options (clang + flang) //===----------------------------------------------------------------------===// let Flags = [TargetSpecific] in { let Visibility = [ClangOption, FlangOption] in { diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index d0c8bdba0ede95..4243ee006c1553 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2021,7 +2021,7 @@ void Driver::PrintHelp(bool ShowHidden) const { void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { if (IsFlangMode()) { - OS << getClangToolFullVersion("flang-new") << '\n'; + OS << getClangToolFullVersion("flang") << '\n'; } else { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 98350690f8d20e..1ca12ff81389a3 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -881,14 +881,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); - // TODO: Replace flang-new with flang once the new driver replaces the - // throwaway driver - const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC)); + const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs, Output)); } -Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {} +Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {} diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 index ad4a3a3b6bd44d..b52977ee66d7b0 100644 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 index e89c053b327bc9..88aedc39fb94a7 100644 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/clang/test/Driver/flang/multiple-inputs-mixed.f90 index 2395dbecf1fe92..98d8cab00bdfdb 100644 --- a/clang/test/Driver/flang/multiple-inputs-mixed.f90 +++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90 @@ -1,7 +1,7 @@ ! Check that flang can handle mixed C and fortran inputs. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c" diff --git a/clang/test/Driver/flang/multiple-inputs.f90 b/clang/test/Driver/flang/multiple-inputs.f90 index ada999e927a6a0..3c0f22e5d3e508 100644 --- a/clang/test/Driver/flang/multiple-inputs.f90 +++ b/clang/test/Driver/flang/multiple-inputs.f90 @@ -1,7 +1,7 @@ ! Check that flang driver can handle multiple inputs at once. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90" diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 815c26a28dfdfa..47cf078cf2d0d4 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: -* the compiler driver, `flang-new` -* the frontend driver, `flang-new -fc1` - -> **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the -> diagrams reflect the final design that we are still working towards. +* the compiler driver, `flang` +* the frontend driver, `flang -fc1` The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering and linking). For frontend specific tasks, the compiler driver creates a -Fortran compilation job and delegates it to `flang-new -fc1`, the frontend +Fortran compilation job and delegates it to `flang -fc1`, the frontend driver. For linking, it creates a linker job and calls an external linker (e.g. LLVM's [`lld`](https://lld.llvm.org/)). It can also call other tools such as external assemblers (e.g. [`as`](https://www.gnu.org/software/binutils/)). In @@ -47,7 +43,7 @@ frontend. It uses MLIR and LLVM for code-generation and can be viewed as a driver for Flang, LLVM and MLIR libraries. Contrary to the compiler driver, it is not capable of calling any external tools (including linkers). It is aware of all the frontend internals that are "hidden" from the compiler driver. It -accepts many frontend-specific options not available in `flang-new` and as such +accepts many frontend-specific options not available in `flang` and as such it provides a finer control over the frontend. Note that this tool is mostly intended for Flang developers. In particular, there are no guarantees about the stability of its interface and compiler developers can use it to experiment @@ -62,30 +58,30 @@ frontend specific flag from the _compiler_ directly to the _frontend_ driver, e.g.: ```bash -flang-new -Xflang -fdebug-dump-parse-tree input.f95 +flang -Xflang -fdebug-dump-parse-tree input.f95 ``` -In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang-new +In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang -fc1`. Without the forwarding flag, `-Xflang`, you would see the following warning: ```bash -flang-new: warning: argument unused during compilation: +flang: warning: argument unused during compilation: ``` -As `-fdebug-dump-parse-tree` is only supported by `flang-new -fc1`, `flang-new` +As `-fdebug-dump-parse-tree` is only supported by `flang -fc1`, `flang` will ignore it when used without `Xflang`. ## Why Do We Need Two Drivers? -As hinted above, `flang-new` and `flang-new -fc1` are two separate tools. The -fact that these tools are accessed through one binary, `flang-new`, is just an +As hinted above, `flang` and `flang -fc1` are two separate tools. The +fact that these tools are accessed through one binary, `flang`, is just an implementation detail. Each tool has a separate list of options, albeit defined in the same file: `clang/include/clang/Driver/Options.td`. The separation helps us split various tasks and allows us to implement more -specialised tools. In particular, `flang-new` is not aware of various +specialised tools. In particular, `flang` is not aware of various compilation phases within the frontend (e.g. scanning, parsing or semantic -checks). It does not have to be. Conversely, the frontend driver, `flang-new +checks). It does not have to be. Conversely, the frontend driver, `flang -fc1`, needs not to be concerned with linkers or other external tools like assemblers. Nor does it need to know where to look for various systems libraries, which is usually OS and platform specific. @@ -104,7 +100,7 @@ GCC](https://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/GNU_C_Compiler_Archi In fact, Flang needs to adhere to this model in order to be able to re-use Clang's driver library. If you are more familiar with the [architecture of GFortran](https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gfortran/About-GNU-Fortran.html) -than Clang, then `flang-new` corresponds to `gfortran` and `flang-new -fc1` to +than Clang, then `flang` corresponds to `gfortran` and `flang -fc1` to `f951`. ## Compiler Driver @@ -135,7 +131,7 @@ output from one action is the input for the subsequent one. You can use the `-ccc-print-phases` flag to see the sequence of actions that the driver will create for your compiler invocation: ```bash -flang-new -ccc-print-phases -E file.f +flang -ccc-print-phases -E file.f +- 0: input, "file.f", f95-cpp-input 1: preprocessor, {0}, f95 ``` @@ -143,7 +139,7 @@ As you can see, for `-E` the driver creates only two jobs and stops immediately after preprocessing. The first job simply prepares the input. For `-c`, the pipeline of the created jobs is more complex: ```bash -flang-new -ccc-print-phases -c file.f +flang -ccc-print-phases -c file.f +- 0: input, "file.f", f95-cpp-input +- 1: preprocessor, {0}, f95 +- 2: compiler, {1}, ir @@ -158,7 +154,7 @@ command to call the frontend driver is generated (more specifically, an instance of `clang::driver::Command`). Every command is bound to an instance of `clang::driver::Tool`. For Flang we introduced a specialisation of this class: `clang::driver::Flang`. This class implements the logic to either translate or -forward compiler options to the frontend driver, `flang-new -fc1`. +forward compiler options to the frontend driver, `flang -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). @@ -232,12 +228,12 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/driver.cpp`. It can be accessed by -invoking the compiler driver, `flang-new`, with the `-fc1` flag. +invoking the compiler driver, `flang`, with the `-fc1` flag. The frontend driver will only run one action at a time. If you specify multiple action flags, only the last one will be taken into account. The default action is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other -words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only +words, `flang -fc1 ` is equivalent to `flang -fc1 -fsyntax-only `. ## Adding new Compiler Options @@ -262,8 +258,8 @@ similar semantics to your new option and start by copying that. For every new option, you will also have to define the visibility of the new option. This is controlled through the `Visibility` field. You can use the following Flang specific visibility flags to control this: - * `FlangOption` - this option will be available in the `flang-new` compiler driver, - * `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver, + * `FlangOption` - this option will be available in the `flang` compiler driver, + * `FC1Option` - this option will be available in the `flang -fc1` frontend driver, Options that are supported by clang should explicitly specify `ClangOption` in `Visibility`, and options that are only supported in Flang should not specify @@ -290,10 +286,10 @@ The parsing will depend on the semantics encoded in the TableGen definition. When adding a compiler driver option (i.e. an option that contains `FlangOption` among in it's `Visibility`) that you also intend to be understood -by the frontend, make sure that it is either forwarded to `flang-new -fc1` or +by the frontend, make sure that it is either forwarded to `flang -fc1` or translated into some other option that is accepted by the frontend driver. In the case of options that contain both `FlangOption` and `FC1Option` among its -flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is +flags, we usually just forward from `flang` to `flang -fc1`. This is then tested in `flang/test/Driver/frontend-forward.F90`. What follows is usually very dependant on the meaning of the corresponding @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use -`flang-new` as follows: +`flang` as follows: ```bash -cmake -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` @@ -353,14 +349,14 @@ where `` corresponds to the LLVM Flang version. ## Testing In LIT, we define two variables that you can use to invoke Flang's drivers: -* `%flang` is expanded as `flang-new` (i.e. the compiler driver) -* `%flang_fc1` is expanded as `flang-new -fc1` (i.e. the frontend driver) +* `%flang` is expanded as `flang` (i.e. the compiler driver) +* `%flang_fc1` is expanded as `flang -fc1` (i.e. the frontend driver) For most regression tests for the frontend, you will want to use `%flang_fc1`. In some cases, the observable behaviour will be identical regardless of whether `%flang` or `%flang_fc1` is used. However, when you are using `%flang` instead of `%flang_fc1`, the compiler driver will add extra flags to the frontend -driver invocation (i.e. `flang-new -fc1 -`). In some cases that might +driver invocation (i.e. `flang -fc1 -`). In some cases that might be exactly what you want to test. In fact, you can check these additional flags by using the `-###` compiler driver command line option. @@ -380,7 +376,7 @@ plugins. The process for using plugins includes: * [Creating a plugin](#creating-a-plugin) * [Loading and running a plugin](#loading-and-running-a-plugin) -Flang plugins are limited to `flang-new -fc1` and are currently only available / +Flang plugins are limited to `flang -fc1` and are currently only available / been tested on Linux. ### Creating a Plugin @@ -465,14 +461,14 @@ static FrontendPluginRegistry::Add X( ### Loading and Running a Plugin In order to use plugins, there are 2 command line options made available to the -frontend driver, `flang-new -fc1`: +frontend driver, `flang -fc1`: * [`-load `](#the--load-dsopath-option) for loading the dynamic shared object of the plugin * [`-plugin `](#the--plugin-name-option) for calling the registered plugin Invocation of the example plugin is done through: ```bash -flang-new -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 +flang -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 ``` Both these options are parsed in `flang/lib/Frontend/CompilerInvocation.cpp` and @@ -493,7 +489,7 @@ reports an error diagnostic and returns `nullptr`. ### Enabling In-Tree Plugins For in-tree plugins, there is the CMake flag `FLANG_PLUGIN_SUPPORT`, enabled by -default, that controls the exporting of executable symbols from `flang-new`, +default, that controls the exporting of executable symbols from `flang`, which plugins need access to. Additionally, there is the CMake flag `LLVM_BUILD_EXAMPLES`, turned off by default, that is used to control if the example programs are built. This includes plugins that are in the @@ -526,7 +522,7 @@ invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and `invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal passes at different points of the default pass pipeline. An example use of these extension point callbacks is shown in `registerDefaultInlinerPass` to invoke the -default inliner pass in `flang-new`. +default inliner pass in `flang`. ## LLVM Pass Plugins @@ -539,7 +535,7 @@ documentation for [`llvm::PassBuilder`](https://llvm.org/doxygen/classllvm_1_1PassBuilder.html) for details. -The framework to enable pass plugins in `flang-new` uses the exact same +The framework to enable pass plugins in `flang` uses the exact same machinery as that used by `clang` and thus has the same capabilities and limitations. @@ -547,7 +543,7 @@ In order to use a pass plugin, the pass(es) must be compiled into a dynamic shared object which is then loaded using the `-fpass-plugin` option. ``` -flang-new -fpass-plugin=/path/to/plugin.so +flang -fpass-plugin=/path/to/plugin.so ``` This option is available in both the compiler driver and the frontend driver. @@ -559,7 +555,7 @@ Pass extensions are similar to plugins, except that they can also be linked statically. Setting `-DLLVM_${NAME}_LINK_INTO_TOOLS` to `ON` in the cmake command turns the project into a statically linked extension. An example would be Polly, e.g., using `-DLLVM_POLLY_LINK_INTO_TOOLS=ON` would link Polly passes -into `flang-new` as built-in middle-end passes. +into `flang` as built-in middle-end passes. See the [`WritingAnLLVMNewPMPass`](https://llvm.org/docs/WritingAnLLVMNewPMPass.html#id9) diff --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md index 5b583d4f8031b8..598ef696ad14bf 100644 --- a/flang/docs/ImplementingASemanticCheck.md +++ b/flang/docs/ImplementingASemanticCheck.md @@ -68,7 +68,7 @@ of the call to `intentOutFunc()`: I also used this program to produce a parse tree for the program using the command: ```bash - flang-new -fc1 -fdebug-dump-parse-tree testfun.f90 + flang -fc1 -fdebug-dump-parse-tree testfun.f90 ``` Here's the relevant fragment of the parse tree produced by the compiler: @@ -296,7 +296,7 @@ In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation: I then built the compiler with these changes and ran it on my test program. This time, I made sure to invoke semantic checking. Here's the command I used: ```bash - flang-new -fc1 -fdebug-unparse-with-symbols testfun.f90 + flang -fc1 -fdebug-unparse-with-symbols testfun.f90 ``` This produced the output: diff --git a/flang/docs/Overview.md b/flang/docs/Overview.md index 6eba19ea3a3c0d..dfb4d89264a755 100644 --- a/flang/docs/Overview.md +++ b/flang/docs/Overview.md @@ -65,8 +65,8 @@ See [Preprocessing.md](Preprocessing.md). **Entry point:** `parser::Parsing::Prescan` **Commands:** - - `flang-new -fc1 -E src.f90` dumps the cooked character stream - - `flang-new -fc1 -fdebug-dump-provenance src.f90` dumps provenance + - `flang -fc1 -E src.f90` dumps the cooked character stream + - `flang -fc1 -fdebug-dump-provenance src.f90` dumps provenance information ### Parsing @@ -80,10 +80,10 @@ representing a syntactically correct program, rooted at the program unit. See: **Entry point:** `parser::Parsing::Parse` **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree - - `flang-new -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran - - `flang-new -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log - - `flang-new -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree + - `flang -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree + - `flang -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran + - `flang -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log + - `flang -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree ### Semantic processing @@ -121,9 +121,9 @@ In the course of semantic analysis, the compiler: At the end of semantic processing, all validation of the user's program is complete. This is the last detailed phase of analysis processing. **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis - - `flang-new -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table - - `flang-new -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table + - `flang -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis + - `flang -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table + - `flang -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table ## Lowering @@ -163,8 +163,8 @@ contain a list of evaluations. All of these contain pointers back into the parse tree. The compiler walks the PFT generating FIR. **Commands:** - - `flang-new -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree - - `flang-new -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir + - `flang -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree + - `flang -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir ### Transformation passes @@ -180,8 +180,8 @@ perform various optimizations and transformations. The final pass creates an LLVM IR representation of the program. **Commands:** - - `flang-new -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error - - `flang-new -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll + - `flang -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error + - `flang -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll ## Object code generation and linking diff --git a/flang/examples/FlangOmpReport/FlangOmpReport.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp index 9c1f304b9741e7..709c5c5d305e51 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReport.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp @@ -9,7 +9,7 @@ // all the OpenMP constructs and clauses and which line they're located on. // // The plugin may be invoked as: -// ./bin/flang-new -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report +// ./bin/flang -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report // -fopenmp // //===----------------------------------------------------------------------===// diff --git a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h index 9a70b7fbfad2b6..8ab5150cd7c812 100644 --- a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h +++ b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h @@ -67,7 +67,7 @@ struct AliasAnalysis { // end subroutine // ------------------------------------------------- // - // flang-new -fc1 -emit-fir test.f90 -o test.fir + // flang -fc1 -emit-fir test.f90 -o test.fir // // ------------------- test.fir -------------------- // fir.global @_QMtopEa : !fir.box>> diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h index 3e703de545950c..df4b21ada058fe 100644 --- a/flang/include/flang/Tools/CrossToolHelpers.h +++ b/flang/include/flang/Tools/CrossToolHelpers.h @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // A header file for containing functionallity that is used across Flang tools, // such as helper functions which apply or generate information needed accross -// tools like bbc and flang-new. +// tools like bbc and flang. //===----------------------------------------------------------------------===// #ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 05b03ba9ebdf30..18383eaafb1136 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -65,8 +65,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static bool parseShowColorsArgs(const llvm::opt::ArgList &args, bool defaultColor = true) { // Color diagnostics default to auto ("on" if terminal supports) in the - // compiler driver `flang-new` but default to off in the frontend driver - // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color. + // compiler driver `flang` but default to off in the frontend driver + // `flang -fc1`, needing an explicit OPT_fdiagnostics_color. // Support both clang's -f[no-]color-diagnostics and gcc's // -f[no-]diagnostics-colors[=never|always|auto]. enum { @@ -891,7 +891,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, } } - // Default to off for `flang-new -fc1`. + // Default to off for `flang -fc1`. res.getFrontendOpts().showColors = parseShowColorsArgs(args, /*defaultDiagColor=*/false); diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 4a52edc436e0ed..8f882bff170909 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -233,7 +233,7 @@ bool CodeGenAction::beginSourceFileAction() { llvm::SMDiagnostic err; llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx); if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) { - err.print("flang-new", llvm::errs()); + err.print("flang", llvm::errs()); unsigned diagID = ci.getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Error, "Could not parse IR"); ci.getDiagnostics().Report(diagID); diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e2cbd5112d6ea5..09ac129d3e6893 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->getFrontendOpts().showHelp) { clang::driver::getDriverOptTable().printHelp( - llvm::outs(), "flang-new -fc1 [options] file...", - "LLVM 'Flang' Compiler", + llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler", /*ShowHidden=*/false, /*ShowAllAliases=*/false, llvm::opt::Visibility(clang::driver::options::FC1Option)); return true; diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 0ad1b718d5875b..cdd2de541c6730 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -308,12 +308,12 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries" # If FortranRuntime is part of a Flang build (and not a separate build) then # add dependency to make sure that Fortran runtime library is being built after # we have the Flang compiler available. This also includes the MODULE files -# that compile when the 'flang-new' target is built. +# that compile when the 'flang' target is built. # # TODO: This is a workaround and should be updated when runtime build procedure # is changed to a regular runtime build. See discussion in PR #95388. -if (TARGET flang-new AND TARGET module_files) - add_dependencies(FortranRuntime flang-new module_files) +if (TARGET flang AND TARGET module_files) + add_dependencies(FortranRuntime flang module_files) endif() if (FLANG_CUF_RUNTIME) diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index a18a5c6519eda4..cab214c2ef4c8c 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -58,7 +58,7 @@ set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) set(FLANG_TEST_DEPENDS - flang-new + flang llvm-config FileCheck count diff --git a/flang/test/Driver/aarch64-outline-atomics.f90 b/flang/test/Driver/aarch64-outline-atomics.f90 index a1c874c20df5c7..530bfc8e962091 100644 --- a/flang/test/Driver/aarch64-outline-atomics.f90 +++ b/flang/test/Driver/aarch64-outline-atomics.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! Test that flang forwards the -moutline-atomics and -mno-outline-atomics. ! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s ! CHECK: "-target-feature" "+outline-atomics" diff --git a/flang/test/Driver/color-diagnostics-forwarding.f90 b/flang/test/Driver/color-diagnostics-forwarding.f90 index 368fa8834142ab..29061242cb0cbc 100644 --- a/flang/test/Driver/color-diagnostics-forwarding.f90 +++ b/flang/test/Driver/color-diagnostics-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards -f{no-}color-diagnostics and -! -f{no-}diagnostics-color options to flang-new -fc1 as expected. +! Test that flang forwards -f{no-}color-diagnostics and +! -f{no-}diagnostics-color options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \ ! RUN: | FileCheck %s --check-prefix=CHECK-CD diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90 index 7ec29ce7ba7abf..cefa86836abd30 100644 --- a/flang/test/Driver/compiler-options.f90 +++ b/flang/test/Driver/compiler-options.f90 @@ -1,6 +1,6 @@ ! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s -! Test communication of COMPILER_OPTIONS from flang-new to flang-new -fc1. -! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang-new{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" +! Test communication of COMPILER_OPTIONS from flang to flang -fc1. +! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" program main use ISO_FORTRAN_ENV, only: compiler_options implicit none diff --git a/flang/test/Driver/convert.f90 b/flang/test/Driver/convert.f90 index b2cf6c23efdb75..0ba31d2188cdf5 100755 --- a/flang/test/Driver/convert.f90 +++ b/flang/test/Driver/convert.f90 @@ -12,7 +12,7 @@ ! RUN: not %flang -fconvert=foobar %s 2>&1 | FileCheck %s --check-prefix=INVALID !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -emit-mlir -fconvert=unknown %s -o - | FileCheck %s --check-prefix=VALID_FC1 ! RUN: %flang_fc1 -emit-mlir -fconvert=native %s -o - | FileCheck %s --check-prefix=VALID_FC1 diff --git a/flang/test/Driver/disable-ext-name-interop.f90 b/flang/test/Driver/disable-ext-name-interop.f90 index 0c59a5b4c980f8..1ade84b996d043 100644 --- a/flang/test/Driver/disable-ext-name-interop.f90 +++ b/flang/test/Driver/disable-ext-name-interop.f90 @@ -1,4 +1,4 @@ -! Test that we can disable the ExternalNameConversion pass in flang-new. +! Test that we can disable the ExternalNameConversion pass in flang. ! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=EXTNAMES ! RUN: %flang_fc1 -S -mmlir -disable-external-name-interop %s -o - 2>&1 | FileCheck %s --check-prefix=INTNAMES diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index d1e1e1d90fe1f8..4c6aecb1c4fa7e 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -4,12 +4,12 @@ ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 -! VERSION: flang-new version +! VERSION: flang version ! VERSION-NEXT: Target: ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang-new: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/escaped-backslash.f90 b/flang/test/Driver/escaped-backslash.f90 index ad07eae24e9fab..90dd1783dd1150 100644 --- a/flang/test/Driver/escaped-backslash.f90 +++ b/flang/test/Driver/escaped-backslash.f90 @@ -1,14 +1,14 @@ ! Ensure argument -fbackslash works as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED diff --git a/flang/test/Driver/fdefault.f90 b/flang/test/Driver/fdefault.f90 index 88592bfa3e87ee..7ce45b763a240f 100644 --- a/flang/test/Driver/fdefault.f90 +++ b/flang/test/Driver/fdefault.f90 @@ -2,25 +2,25 @@ ! TODO: Add checks when actual codegen is possible for this family !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! NOOPTION: integer(4),parameter::real_kind=4_4 diff --git a/flang/test/Driver/flarge-sizes.f90 b/flang/test/Driver/flarge-sizes.f90 index 6ea5876676ed1f..6c41a03a830bfb 100644 --- a/flang/test/Driver/flarge-sizes.f90 +++ b/flang/test/Driver/flarge-sizes.f90 @@ -2,20 +2,20 @@ ! TODO: Add checks when actual codegen is possible. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE ! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 diff --git a/flang/test/Driver/frame-pointer-forwarding.f90 b/flang/test/Driver/frame-pointer-forwarding.f90 index 751494cc6a6017..9fcbd6e12f98b7 100644 --- a/flang/test/Driver/frame-pointer-forwarding.f90 +++ b/flang/test/Driver/frame-pointer-forwarding.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend +! Test that flang forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend ! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE ! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf" diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 index 35adb47b56861e..0a56a1e3710d9d 100644 --- a/flang/test/Driver/frontend-forwarding.f90 +++ b/flang/test/Driver/frontend-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards Flang frontend -! options to flang-new -fc1 as expected. +! Test that flang forwards Flang frontend +! options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \ ! RUN: -finput-charset=utf-8 \ diff --git a/flang/test/Driver/hlfir-no-hlfir-error.f90 b/flang/test/Driver/hlfir-no-hlfir-error.f90 index 2410393b6cd9c1..59f8304db5c9ab 100644 --- a/flang/test/Driver/hlfir-no-hlfir-error.f90 +++ b/flang/test/Driver/hlfir-no-hlfir-error.f90 @@ -2,12 +2,12 @@ ! options cannot be both used. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -emit-llvm -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s diff --git a/flang/test/Driver/intrinsic-module-path.f90 b/flang/test/Driver/intrinsic-module-path.f90 index 5523ed37b724cd..15d19dd83d963f 100644 --- a/flang/test/Driver/intrinsic-module-path.f90 +++ b/flang/test/Driver/intrinsic-module-path.f90 @@ -4,7 +4,7 @@ ! default one, causing a CHECKSUM error. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/large-data-threshold.f90 b/flang/test/Driver/large-data-threshold.f90 index 320566c4b2e43a..6a7eef79559d0b 100644 --- a/flang/test/Driver/large-data-threshold.f90 +++ b/flang/test/Driver/large-data-threshold.f90 @@ -7,11 +7,11 @@ ! RUN: not %flang -### -c --target=aarch64 -mcmodel=small -mlarge-data-threshold=32768 %s 2>&1 | FileCheck %s --check-prefix=NOT-SUPPORTED -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-mlarge-data-threshold=32768" -! CHECK-59000: "{{.*}}flang-new" "-fc1" +! CHECK-59000: "{{.*}}flang" "-fc1" ! CHECK-59000-SAME: "-mlarge-data-threshold=59000" -! CHECK-1M: "{{.*}}flang-new" "-fc1" +! CHECK-1M: "{{.*}}flang" "-fc1" ! CHECK-1M-SAME: "-mlarge-data-threshold=1048576" ! NO-MCMODEL: 'mlarge-data-threshold=' only applies to medium and large code models ! INVALID: error: invalid value 'nonsense' in '-mlarge-data-threshold=' diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index a51febc7009691..bad3d972e6bd6b 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang-new: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/macro-def-undef.F90 b/flang/test/Driver/macro-def-undef.F90 index 1332c6d6c02708..b13a9040833dbf 100644 --- a/flang/test/Driver/macro-def-undef.F90 +++ b/flang/test/Driver/macro-def-undef.F90 @@ -1,14 +1,14 @@ ! Ensure arguments -D and -U work as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 236325e3578f1d..51d37a718c542f 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -1,26 +1,26 @@ ! Test the behaviour of the driver when input is missing or is invalid. Note -! that with the compiler driver (flang-new), the input _has_ to be specified. +! that with the compiler driver (flang), the input _has_ to be specified. ! Indeed, the driver decides what "job/command" to create based on the input ! file's extension. No input file means that it doesn't know what to do -! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply +! (compile? preprocess? link?). The frontend driver (flang -fc1) simply ! assumes that "no explicit input == read from stdin" !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE ! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE !----------------------------------------- -! FLANG FRONTEND DRIVER (flang-new -fc1) +! FLANG FRONTEND DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang-new: error: no input files +! FLANG-NO-FILE: flang: error: no input files -! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang-new: error: no input files +! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 6c86f23f2b21fa..64ec8679abf94f 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang-new: error: cannot specify -o when generating multiple output files +! ERROR: flang: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index b0b94ab1386a74..7c51656f0001af 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -1,6 +1,6 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected. Assumes a gfx90a, aarch64, ! and sm_70 architecture, but doesn't require one to be ! installed or compiled for, just testing the appropriate ! generation of jobs are created with the correct @@ -8,8 +8,8 @@ ! Test regular -fopenmp with no offload ! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s -! CHECK-OPENMP: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" -! CHECK-OPENMP-NOT: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" +! CHECK-OPENMP-NOT: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Test regular -fopenmp with offload, and invocation filtering options ! RUN: %flang -S -### %s -o %t 2>&1 \ @@ -22,47 +22,47 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST -! OFFLOAD-HOST: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE -! OFFLOAD-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp ! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s -! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS -! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" ! OPENMP-OFFLOAD-ARGS-SAME: {{.*}}.f90" ! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fembed-offload-object={{.*}}.out" {{.*}}.bc" @@ -77,7 +77,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-threads-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS -! CHECK-THREADS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" +! CHECK-THREADS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -89,7 +89,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-teams-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS -! CHECK-TEAMS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" +! CHECK-TEAMS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -101,7 +101,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-nested-parallelism \ ! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR -! CHECK-NEST-PAR: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" +! CHECK-NEST-PAR: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -113,7 +113,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE -! CHECK-THREAD-STATE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" +! CHECK-THREAD-STATE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -125,7 +125,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" +! CHECK-TARGET-DEBUG: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -137,7 +137,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" +! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -153,7 +153,7 @@ ! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL -! CHECK-RTL-ALL: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" +! CHECK-RTL-ALL: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" ! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism" ! CHECK-RTL-ALL: {{.*}}.f90" @@ -167,7 +167,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-version=45 \ ! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION -! CHECK-OPENMP-VERSION: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" +! CHECK-OPENMP-VERSION: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" ! Test diagnostic error when host IR file is non-existent ! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \ @@ -187,7 +187,7 @@ ! RUN: --target=aarch64-unknown-linux-gnu \ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-NO-OFFLOAD -! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-NO-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! Test -fopenmp-force-usm option with offload @@ -196,16 +196,16 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-OFFLOAD -! FORCE-USM-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" -! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \ ! RUN: --offload-arch=gfx900 \ ! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ ! RUN: | FileCheck --check-prefix=MLINK-BUILTIN-BITCODE %s -! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! MLINK-BUILTIN-BITCODE-SAME: "-mlink-builtin-bitcode" {{.*Inputs.*rocm.*amdgcn.*bitcode.*}}oclc_isa_version_900.bc ! Test that the -fopenmp-targets option is added to host compilation invocations @@ -219,9 +219,9 @@ ! RUN: --target=x86_64-unknown-linux-gnu -nogpulib \ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-TARGETS -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" -! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-TARGETS-NOT: -fopenmp-targets -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" diff --git a/flang/test/Driver/predefined-macros-compiler-version.F90 b/flang/test/Driver/predefined-macros-compiler-version.F90 index 823a730f96845a..f6924479281562 100644 --- a/flang/test/Driver/predefined-macros-compiler-version.F90 +++ b/flang/test/Driver/predefined-macros-compiler-version.F90 @@ -1,12 +1,12 @@ ! Check that the driver correctly defines macros with the compiler version !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case diff --git a/flang/test/Driver/std2018-wrong.f90 b/flang/test/Driver/std2018-wrong.f90 index 27ccc76bd39aad..93ba153d75f7f9 100644 --- a/flang/test/Driver/std2018-wrong.f90 +++ b/flang/test/Driver/std2018-wrong.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG diff --git a/flang/test/Driver/std2018.f90 b/flang/test/Driver/std2018.f90 index cf461cf89e4e19..1727f92127b711 100644 --- a/flang/test/Driver/std2018.f90 +++ b/flang/test/Driver/std2018.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03 index 6e03f9f43fc602..1d850305cd040e 100644 --- a/flang/test/Driver/supported-suffices/f03-suffix.f03 +++ b/flang/test/Driver/supported-suffices/f03-suffix.f03 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f03 end program f03 diff --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08 index d5bcf4ce1de1cc..2b31e4c21876ae 100644 --- a/flang/test/Driver/supported-suffices/f08-suffix.f08 +++ b/flang/test/Driver/supported-suffices/f08-suffix.f08 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f08 end program f08 diff --git a/flang/test/Driver/use-module-error.f90 b/flang/test/Driver/use-module-error.f90 index 42d6650621c8c8..67335f61626817 100644 --- a/flang/test/Driver/use-module-error.f90 +++ b/flang/test/Driver/use-module-error.f90 @@ -1,14 +1,14 @@ ! Ensure that multiple module directories are not allowed !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE diff --git a/flang/test/Driver/use-module.f90 b/flang/test/Driver/use-module.f90 index 775c0424715883..2c3a38043fe16e 100644 --- a/flang/test/Driver/use-module.f90 +++ b/flang/test/Driver/use-module.f90 @@ -1,7 +1,7 @@ ! Checks that module search directories specified with `-J/-module-dir` and `-I` are handled correctly !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty @@ -16,7 +16,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty diff --git a/flang/test/Driver/version-loops.f90 b/flang/test/Driver/version-loops.f90 index b0fa01d572512a..d206393a04f486 100644 --- a/flang/test/Driver/version-loops.f90 +++ b/flang/test/Driver/version-loops.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards the -f{no-,}version-loops-for-stride -! options correctly to flang-new -fc1 for different variants of optimisation +! Test that flang forwards the -f{no-,}version-loops-for-stride +! options correctly to flang -fc1 for different variants of optimisation ! and explicit flags. ! RUN: %flang -### %s -o %t 2>&1 -O3 \ @@ -23,32 +23,32 @@ ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \ ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-fversion-loops-for-stride" ! CHECK-SAME: "-O3" -! CHECK-O2: "{{.*}}flang-new" "-fc1" +! CHECK-O2: "{{.*}}flang" "-fc1" ! CHECK-O2-NOT: "-fversion-loops-for-stride" ! CHECK-O2-SAME: "-O2" -! CHECK-O2-with: "{{.*}}flang-new" "-fc1" +! CHECK-O2-with: "{{.*}}flang" "-fc1" ! CHECK-O2-with-SAME: "-fversion-loops-for-stride" ! CHECK-O2-with-SAME: "-O2" -! CHECK-O4: "{{.*}}flang-new" "-fc1" +! CHECK-O4: "{{.*}}flang" "-fc1" ! CHECK-O4-SAME: "-fversion-loops-for-stride" ! CHECK-O4-SAME: "-O3" -! CHECK-Ofast: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast: "{{.*}}flang" "-fc1" ! CHECK-Ofast-SAME: "-ffast-math" ! CHECK-Ofast-SAME: "-fversion-loops-for-stride" ! CHECK-Ofast-SAME: "-O3" -! CHECK-Ofast-no: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast-no: "{{.*}}flang" "-fc1" ! CHECK-Ofast-no-SAME: "-ffast-math" ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride" ! CHECK-Ofast-no-SAME: "-O3" -! CHECK-O3-no: "{{.*}}flang-new" "-fc1" +! CHECK-O3-no: "{{.*}}flang" "-fc1" ! CHECK-O3-no-NOT: "-fversion-loops-for-stride" ! CHECK-O3-no-SAME: "-O3" diff --git a/flang/test/Driver/wextra-ok.f90 b/flang/test/Driver/wextra-ok.f90 index 6a38d9481a36b7..441029aa0af276 100644 --- a/flang/test/Driver/wextra-ok.f90 +++ b/flang/test/Driver/wextra-ok.f90 @@ -1,4 +1,4 @@ -! Ensure that supplying -Wextra into flang-new does not raise error +! Ensure that supplying -Wextra into flang does not raise error ! The first check should be changed if -Wextra is implemented ! RUN: %flang -std=f2018 -Wextra %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-OK diff --git a/flang/test/HLFIR/hlfir-flags.f90 b/flang/test/HLFIR/hlfir-flags.f90 index b383a79d12c27b..0b1e80b1e3f636 100644 --- a/flang/test/HLFIR/hlfir-flags.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,4 +1,4 @@ -! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang-new), and +! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang), and ! -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s diff --git a/flang/test/Lower/Intrinsics/command_argument_count.f90 b/flang/test/Lower/Intrinsics/command_argument_count.f90 index 0cf92d4444db98..a30b27d664fc0c 100644 --- a/flang/test/Lower/Intrinsics/command_argument_count.f90 +++ b/flang/test/Lower/Intrinsics/command_argument_count.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver -! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s +! bbc doesn't have a way to set the default kinds so we use flang driver +! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s ! CHECK-LABEL: argument_count_test subroutine argument_count_test() diff --git a/flang/test/Lower/Intrinsics/exit.f90 b/flang/test/Lower/Intrinsics/exit.f90 index c3110fcbec2b5a..bd551f7318a84a 100644 --- a/flang/test/Lower/Intrinsics/exit.f90 +++ b/flang/test/Lower/Intrinsics/exit.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver +! bbc doesn't have a way to set the default kinds so we use flang driver ! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s ! CHECK-LABEL: func @_QPexit_test1() { diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 index f9ab01881d250d..9b864c9a9849c3 100644 --- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 +++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: ieee_is_normal_f16 subroutine ieee_is_normal_f16(r) diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90 index 700b2d1a67c656..62b98c8ea98bee 100644 --- a/flang/test/Lower/Intrinsics/isnan.f90 +++ b/flang/test/Lower/Intrinsics/isnan.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: isnan_f32 subroutine isnan_f32(r) diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90 index ac18e59033a6b6..781ef8296a2b7d 100644 --- a/flang/test/Lower/Intrinsics/modulo.f90 +++ b/flang/test/Lower/Intrinsics/modulo.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL -! RUN: flang-new -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL +! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL ! ALL-LABEL: func @_QPmodulo_testr( ! ALL-SAME: %[[arg0:.*]]: !fir.ref{{.*}}, %[[arg1:.*]]: !fir.ref{{.*}}, %[[arg2:.*]]: !fir.ref{{.*}}) { diff --git a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 index f02884e5e92f38..425ccbc5dd56c5 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP allocate Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s program main integer :: x, y diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 index 3be61a1700ced3..7a7d28db8d6f5a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare reduction Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine declare_red() integer :: my_var diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 index c6a0a8f2cd0d22..be1ac2db5dfa4a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare simd Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine sub(x, y) real, intent(inout) :: x, y diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 index 62bc247a1456a1..bc5baf4e1cf604 100644 --- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 +++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 @@ -1,7 +1,7 @@ ! This test checks lowering of `LASTPRIVATE` clause for scalar types. ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s !CHECK: func @_QPlastprivate_character(%[[ARG1:.*]]: !fir.boxchar<1>{{.*}}) { !CHECK-DAG: %[[ARG1_UNBOX:.*]]:2 = fir.unboxchar diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 index 32caac39778dee..99c521406a7775 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(byref @add_reduction_byref_i32 diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 index fdedbb06160761..cfeb5de83f4e82 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(@add_reduction_i32 diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 4acbc0606d1977..f43234fb125b7e 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -132,13 +132,13 @@ tools = [ ToolSubst( "%flang", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=isysroot_flag, unresolved="fatal", ), ToolSubst( "%flang_fc1", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=["-fc1"], unresolved="fatal", ), diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 9d7b8633958cb7..4362fcf0537616 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set(module_objects "") # Create module files directly from the top-level module source directory. -# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was +# If CMAKE_CROSSCOMPILING, then the newly built flang executable was # cross compiled, and thus can't be executed on the build system and thus # can't be used for generating module files. if (NOT CMAKE_CROSSCOMPILING) @@ -115,9 +115,9 @@ if (NOT CMAKE_CROSSCOMPILING) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${FLANG_SOURCE_DIR}/module/${filename}.f90 - DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) list(APPEND MODULE_FILES ${base}.mod) install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") @@ -142,9 +142,9 @@ if (NOT CMAKE_CROSSCOMPILING) set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib) add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 - DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} + DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} ) add_custom_command(OUTPUT ${base}.f18.mod DEPENDS ${base}.mod diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 9f33cdfe3fa90f..615c673374faf4 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS TargetParser ) -add_flang_tool(flang-new +add_flang_tool(flang driver.cpp fc1_main.cpp ) -target_link_libraries(flang-new +target_link_libraries(flang PRIVATE flangFrontend flangFrontendTool ) -clang_target_link_libraries(flang-new +clang_target_link_libraries(flang PRIVATE clangDriver clangBasic @@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) -# Enable support for plugins, which need access to symbols from flang-new +# Enable support for plugins, which need access to symbols from flang if(FLANG_PLUGIN_SUPPORT) - export_executable_symbols_for_plugins(flang-new) + export_executable_symbols_for_plugins(flang) endif() -install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 52136df10c0b02..603aab4205836c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -95,7 +95,7 @@ int main(int argc, const char **argv) { llvm::StringSaver saver(a); ExpandResponseFiles(saver, args); - // Check if flang-new is in the frontend mode + // Check if flang is in the frontend mode auto firstArg = std::find_if(args.begin() + 1, args.end(), [](const char *a) { return a != nullptr; }); if (firstArg != args.end()) { @@ -104,7 +104,7 @@ int main(int argc, const char **argv) { << "Valid tools include '-fc1'.\n"; return 1; } - // Call flang-new frontend + // Call flang frontend if (llvm::StringRef(args[1]).starts_with("-fc1")) { return executeFC1Tool(args); } @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { // Set the environment variable, FLANG_COMPILER_OPTIONS_STRING, to contain all // the compiler options. This is intended for the frontend driver, - // flang-new -fc1, to enable the implementation of the COMPILER_OPTIONS + // flang -fc1, to enable the implementation of the COMPILER_OPTIONS // intrinsic. To this end, the frontend driver requires the list of the // original compiler options, which is not available through other means. // TODO: This way of passing information between the compiler and frontend diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index d948b7eb39b39c..9da1f926817a8b 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -504,15 +504,15 @@ if(build_runtimes) if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES) if (${LLVM_TOOL_FLANG_BUILD}) - message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new") - set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new") + message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang") + set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang") set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang") # TODO: This is a workaround until flang becomes a first-class project - # in llvm/CMakeList.txt. Until then, this line ensures that flang-new is - # built before "openmp" is built as a runtime project. Besides "flang-new" + # in llvm/CMakeList.txt. Until then, this line ensures that flang is + # built before "openmp" is built as a runtime project. Besides "flang" # to build the compiler, we also need to add "module_files" to make sure # that all .mod files are also properly build. - list(APPEND extra_deps "flang-new" "module_files") + list(APPEND extra_deps "flang" "module_files") endif() foreach(dep opt llvm-link llvm-extract clang clang-offload-packager) if(TARGET ${dep}) diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 9ffe8f56b76e67..9b771d1116ee38 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -89,9 +89,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 3b4259dfa380e8..c206386fa6b614 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -69,9 +69,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found >From b71c1d519cc61a751268b1ccda3fc59a966bab96 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 26 Sep 2024 10:39:53 -0500 Subject: [PATCH 2/4] [flang][driver] restore flang-new as symlink Restore flang-new as a symlink to flang for backwards compatibility Co-authored-by: H. Vetinari Co-authored-by: Andrzej Warzynski --- clang/lib/Driver/ToolChain.cpp | 3 +++ flang/tools/flang-driver/CMakeLists.txt | 4 ++++ flang/tools/flang-driver/driver.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 16f9b629fc538c..c9f3dbd7707b77 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -381,6 +381,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { {"cl", "--driver-mode=cl"}, {"++", "--driver-mode=g++"}, {"flang", "--driver-mode=flang"}, + // For backwards compatibility, we create a symlink for `flang` called + // `flang-new`. This will be removed in the future. + {"flang-new", "--driver-mode=flang"}, {"clang-dxc", "--driver-mode=dxc"}, }; diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 615c673374faf4..063acdd7dfe57c 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -36,3 +36,7 @@ if(FLANG_PLUGIN_SUPPORT) endif() install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") + +# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang" +# is a widely adopted name. +add_flang_symlink(flang-new flang) diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 603aab4205836c..ed52988feaa59c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -88,7 +88,8 @@ int main(int argc, const char **argv) { llvm::InitLLVM x(argc, argv); llvm::SmallVector args(argv, argv + argc); - clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang"); + clang::driver::ParsedClangName targetandMode = + clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]); std::string driverPath = getExecutablePath(args[0]); llvm::BumpPtrAllocator a; >From 443c951f8e0458e8b011424fad6a2e4b40b63144 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 30 Sep 2024 10:16:59 -0500 Subject: [PATCH 3/4] [flang][driver] add version to flang executable --- flang/tools/flang-driver/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 063acdd7dfe57c..9a89a6185a3291 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -28,6 +28,12 @@ clang_target_link_libraries(flang clangBasic ) +# This creates the executable with a version appended +# and creates a symlink to it without the version +if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows + set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION}) +endif() + option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) # Enable support for plugins, which need access to symbols from flang >From 27ae40d86f235890d109ca88682dd0caba0d2c93 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 3 Oct 2024 14:12:35 -0700 Subject: [PATCH 4/4] [flang][driver] add warning when using openmp --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 3 +++ clang/include/clang/Basic/DiagnosticGroups.td | 4 ++++ clang/lib/Driver/ToolChains/Flang.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 97573fcf20c1fb..68722ad9633120 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning< def warn_drv_unsupported_openmp_library : Warning< "the library '%0=%1' is not supported, OpenMP will not be enabled">, InGroup; +def warn_openmp_experimental : Warning< + "OpenMP support in flang is still experimental">, + InGroup; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 7d81bdf827ea0c..bfa065f018f8d8 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1582,3 +1582,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">; // Warnings about using the non-standard extension having an explicit specialization // with a storage class specifier. def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">; + +// A warning for options that enable a feature that is not yet complete +def ExperimentalOption : DiagGroup<"experimental-option">; + diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 1ca12ff81389a3..19b43594b00815 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); // FIXME: Clang supports a whole bunch more flags here. break; From openmp-commits at lists.llvm.org Thu Oct 3 15:32:12 2024 From: openmp-commits at lists.llvm.org (Joel E. Denny via Openmp-commits) Date: Thu, 03 Oct 2024 15:32:12 -0700 (PDT) Subject: [Openmp-commits] [clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365) In-Reply-To: Message-ID: <66ff1b6c.170a0220.d9bc6.729c@mx.google.com> ================ @@ -1311,4 +1314,96 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File, return 0; } +int __llvm_write_custom_profile(const char *Target, + const __llvm_profile_data *DataBegin, + const __llvm_profile_data *DataEnd, + const char *CountersBegin, + const char *CountersEnd, const char *NamesBegin, + const char *NamesEnd) { + int ReturnValue = 0, FilenameLength, TargetLength; + char *FilenameBuf, *TargetFilename; + const char *Filename; + + /* Save old profile data */ + FILE *oldFile = getProfileFile(); + + // Temporarily suspend getting SIGKILL when the parent exits. + int PDeathSig = lprofSuspendSigKill(); + + if (lprofProfileDumped() || __llvm_profile_is_continuous_mode_enabled()) { + PROF_NOTE("Profile data not written to file: %s.\n", "already written"); + if (PDeathSig == 1) + lprofRestoreSigKill(); + return 0; + } + + /* Get current filename */ + FilenameLength = getCurFilenameLength(); + FilenameBuf = (char *)COMPILER_RT_ALLOCA(FilenameLength + 1); + Filename = getCurFilename(FilenameBuf, 0); + + /* Check the filename. */ + if (!Filename) { + PROF_ERR("Failed to write file : %s\n", "Filename not set"); + if (PDeathSig == 1) + lprofRestoreSigKill(); + return -1; + } + + /* Allocate new space for our target-specific PGO filename */ + TargetLength = strlen(Target); + TargetFilename = + (char *)COMPILER_RT_ALLOCA(FilenameLength + TargetLength + 2); + + /* Prepend "TARGET." to current filename */ ---------------- jdenny-ornl wrote: Can we make this handle file names with directory components? Otherwise, I end up with errors like: ``` LLVM Profile Error: Failed to open file : amdgcn-amd-amdhsa./home/jdenny/tmp/default_15853421304062701701_0.profraw ``` https://github.com/llvm/llvm-project/pull/93365 From openmp-commits at lists.llvm.org Thu Oct 3 16:58:52 2024 From: openmp-commits at lists.llvm.org (Joel E. Denny via Openmp-commits) Date: Thu, 03 Oct 2024 16:58:52 -0700 (PDT) Subject: [Openmp-commits] [clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Add GPU profiling flags to driver (PR #94268) In-Reply-To: Message-ID: <66ff2fbc.170a0220.208f10.7901@mx.google.com> jdenny-ornl wrote: For some codes, I get the following error for a gfx906: ``` LLVM ERROR: Relocation for CG Profile could not be created: unknown relocation name ``` I see it for OpenMC, but the following is a simpler example: ``` $ cat test.c #include #include __attribute__((noinline)) double test(double x, int n) { double res = 1; for (int i = 0; i < n; ++i) res *= x; return res; } int main(int argc, char *argv[]) { double x = atof(argv[1]); unsigned n = atoi(argv[2]); #pragma omp target map(tofrom:x) x = test(x, n); printf("%f\n", x); return 0; } $ clang -O2 -g -fopenmp --offload-arch=native test.c -o test \ -fprofile-generate -fprofile-generate-gpu $ LLVM_PROFILE_FILE=test.profraw ./test 2 4 16.000000 $ llvm-profdata merge -output=test.profdata *.profraw $ clang -O2 -g -fopenmp --offload-arch=native test.c -foffload-lto \ -fprofile-use-gpu=test.profdata ``` I can prevent the error by lowering the last -O2 to -O1 or by removing the `__attribute__((noinline))`. Am I doing something wrong? https://github.com/llvm/llvm-project/pull/94268 From openmp-commits at lists.llvm.org Fri Oct 4 03:40:30 2024 From: openmp-commits at lists.llvm.org (Tom Eccles via Openmp-commits) Date: Fri, 04 Oct 2024 03:40:30 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66ffc61e.620a0220.1e23d.c553@mx.google.com> ================ @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); ---------------- tblah wrote: Please could you add a test that this warning is printed. `flang/test/Driver/fopoenmp.f90` would be a good place. There is an example in the file already checking for a warning. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Fri Oct 4 06:20:14 2024 From: openmp-commits at lists.llvm.org (Michael Kruse via Openmp-commits) Date: Fri, 04 Oct 2024 06:20:14 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030) In-Reply-To: Message-ID: <66ffeb8e.a70a0220.262833.dc51@mx.google.com> Meinersbur wrote: @alexey-bataev Could you have another look? https://github.com/llvm/llvm-project/pull/92030 From openmp-commits at lists.llvm.org Fri Oct 4 06:27:37 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Fri, 04 Oct 2024 06:27:37 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66ffed49.a70a0220.d0e1e.d75c@mx.google.com> https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From 649a73478c78389560042030a9717a05e8e338a8 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/5] [flang][driver] rename flang-new to flang --- .github/workflows/release-binaries.yml | 2 +- clang/include/clang/Driver/Options.td | 4 +- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Driver/ToolChains/Flang.cpp | 6 +- clang/test/Driver/flang/flang.f90 | 2 +- clang/test/Driver/flang/flang_ucase.F90 | 2 +- .../Driver/flang/multiple-inputs-mixed.f90 | 2 +- clang/test/Driver/flang/multiple-inputs.f90 | 4 +- flang/docs/FlangDriver.md | 76 +++++++++---------- flang/docs/ImplementingASemanticCheck.md | 4 +- flang/docs/Overview.md | 26 +++---- .../FlangOmpReport/FlangOmpReport.cpp | 2 +- .../flang/Optimizer/Analysis/AliasAnalysis.h | 2 +- flang/include/flang/Tools/CrossToolHelpers.h | 2 +- flang/lib/Frontend/CompilerInvocation.cpp | 6 +- flang/lib/Frontend/FrontendActions.cpp | 2 +- .../ExecuteCompilerInvocation.cpp | 3 +- flang/runtime/CMakeLists.txt | 6 +- flang/test/CMakeLists.txt | 2 +- flang/test/Driver/aarch64-outline-atomics.f90 | 2 +- .../Driver/color-diagnostics-forwarding.f90 | 4 +- flang/test/Driver/compiler-options.f90 | 4 +- flang/test/Driver/convert.f90 | 2 +- .../test/Driver/disable-ext-name-interop.f90 | 2 +- flang/test/Driver/driver-version.f90 | 4 +- flang/test/Driver/escaped-backslash.f90 | 4 +- flang/test/Driver/fdefault.f90 | 28 +++---- flang/test/Driver/flarge-sizes.f90 | 20 ++--- .../test/Driver/frame-pointer-forwarding.f90 | 2 +- flang/test/Driver/frontend-forwarding.f90 | 4 +- flang/test/Driver/hlfir-no-hlfir-error.f90 | 4 +- flang/test/Driver/intrinsic-module-path.f90 | 2 +- flang/test/Driver/large-data-threshold.f90 | 6 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/macro-def-undef.F90 | 4 +- flang/test/Driver/missing-input.f90 | 14 ++-- flang/test/Driver/multiple-input-files.f90 | 2 +- flang/test/Driver/omp-driver-offload.f90 | 66 ++++++++-------- .../predefined-macros-compiler-version.F90 | 4 +- flang/test/Driver/std2018-wrong.f90 | 2 +- flang/test/Driver/std2018.f90 | 2 +- .../Driver/supported-suffices/f03-suffix.f03 | 2 +- .../Driver/supported-suffices/f08-suffix.f08 | 2 +- flang/test/Driver/use-module-error.f90 | 4 +- flang/test/Driver/use-module.f90 | 4 +- flang/test/Driver/version-loops.f90 | 18 ++--- flang/test/Driver/wextra-ok.f90 | 2 +- flang/test/HLFIR/hlfir-flags.f90 | 2 +- .../Intrinsics/command_argument_count.f90 | 4 +- flang/test/Lower/Intrinsics/exit.f90 | 2 +- .../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +- flang/test/Lower/Intrinsics/isnan.f90 | 2 +- flang/test/Lower/Intrinsics/modulo.f90 | 2 +- .../OpenMP/Todo/omp-declarative-allocate.f90 | 2 +- .../OpenMP/Todo/omp-declare-reduction.f90 | 2 +- .../Lower/OpenMP/Todo/omp-declare-simd.f90 | 2 +- .../parallel-lastprivate-clause-scalar.f90 | 2 +- .../parallel-wsloop-reduction-byref.f90 | 2 +- .../OpenMP/parallel-wsloop-reduction.f90 | 2 +- flang/test/lit.cfg.py | 4 +- flang/tools/f18/CMakeLists.txt | 10 +-- flang/tools/flang-driver/CMakeLists.txt | 12 +-- flang/tools/flang-driver/driver.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 10 +-- offload/CMakeLists.txt | 4 +- openmp/CMakeLists.txt | 4 +- 66 files changed, 220 insertions(+), 227 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 925912df6843e4..6073ebac9e6c2c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -328,7 +328,7 @@ jobs: run: | # Build some of the mlir tools that take a long time to link if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc fi ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \ mlir-bytecode-parser-fuzzer \ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 932cf13edab53d..4a45a825da8fa1 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6071,7 +6071,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; //===----------------------------------------------------------------------===// -// pie/pic options (clang + flang-new) +// pie/pic options (clang + flang) //===----------------------------------------------------------------------===// let Visibility = [ClangOption, FlangOption] in { @@ -6087,7 +6087,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group; } // let Vis = [Default, FlangOption] //===----------------------------------------------------------------------===// -// Target Options (clang + flang-new) +// Target Options (clang + flang) //===----------------------------------------------------------------------===// let Flags = [TargetSpecific] in { let Visibility = [ClangOption, FlangOption] in { diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index d0c8bdba0ede95..4243ee006c1553 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2021,7 +2021,7 @@ void Driver::PrintHelp(bool ShowHidden) const { void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { if (IsFlangMode()) { - OS << getClangToolFullVersion("flang-new") << '\n'; + OS << getClangToolFullVersion("flang") << '\n'; } else { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 98350690f8d20e..1ca12ff81389a3 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -881,14 +881,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); - // TODO: Replace flang-new with flang once the new driver replaces the - // throwaway driver - const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC)); + const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs, Output)); } -Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {} +Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {} diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 index ad4a3a3b6bd44d..b52977ee66d7b0 100644 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 index e89c053b327bc9..88aedc39fb94a7 100644 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/clang/test/Driver/flang/multiple-inputs-mixed.f90 index 2395dbecf1fe92..98d8cab00bdfdb 100644 --- a/clang/test/Driver/flang/multiple-inputs-mixed.f90 +++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90 @@ -1,7 +1,7 @@ ! Check that flang can handle mixed C and fortran inputs. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c" diff --git a/clang/test/Driver/flang/multiple-inputs.f90 b/clang/test/Driver/flang/multiple-inputs.f90 index ada999e927a6a0..3c0f22e5d3e508 100644 --- a/clang/test/Driver/flang/multiple-inputs.f90 +++ b/clang/test/Driver/flang/multiple-inputs.f90 @@ -1,7 +1,7 @@ ! Check that flang driver can handle multiple inputs at once. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90" diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 815c26a28dfdfa..47cf078cf2d0d4 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: -* the compiler driver, `flang-new` -* the frontend driver, `flang-new -fc1` - -> **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the -> diagrams reflect the final design that we are still working towards. +* the compiler driver, `flang` +* the frontend driver, `flang -fc1` The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering and linking). For frontend specific tasks, the compiler driver creates a -Fortran compilation job and delegates it to `flang-new -fc1`, the frontend +Fortran compilation job and delegates it to `flang -fc1`, the frontend driver. For linking, it creates a linker job and calls an external linker (e.g. LLVM's [`lld`](https://lld.llvm.org/)). It can also call other tools such as external assemblers (e.g. [`as`](https://www.gnu.org/software/binutils/)). In @@ -47,7 +43,7 @@ frontend. It uses MLIR and LLVM for code-generation and can be viewed as a driver for Flang, LLVM and MLIR libraries. Contrary to the compiler driver, it is not capable of calling any external tools (including linkers). It is aware of all the frontend internals that are "hidden" from the compiler driver. It -accepts many frontend-specific options not available in `flang-new` and as such +accepts many frontend-specific options not available in `flang` and as such it provides a finer control over the frontend. Note that this tool is mostly intended for Flang developers. In particular, there are no guarantees about the stability of its interface and compiler developers can use it to experiment @@ -62,30 +58,30 @@ frontend specific flag from the _compiler_ directly to the _frontend_ driver, e.g.: ```bash -flang-new -Xflang -fdebug-dump-parse-tree input.f95 +flang -Xflang -fdebug-dump-parse-tree input.f95 ``` -In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang-new +In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang -fc1`. Without the forwarding flag, `-Xflang`, you would see the following warning: ```bash -flang-new: warning: argument unused during compilation: +flang: warning: argument unused during compilation: ``` -As `-fdebug-dump-parse-tree` is only supported by `flang-new -fc1`, `flang-new` +As `-fdebug-dump-parse-tree` is only supported by `flang -fc1`, `flang` will ignore it when used without `Xflang`. ## Why Do We Need Two Drivers? -As hinted above, `flang-new` and `flang-new -fc1` are two separate tools. The -fact that these tools are accessed through one binary, `flang-new`, is just an +As hinted above, `flang` and `flang -fc1` are two separate tools. The +fact that these tools are accessed through one binary, `flang`, is just an implementation detail. Each tool has a separate list of options, albeit defined in the same file: `clang/include/clang/Driver/Options.td`. The separation helps us split various tasks and allows us to implement more -specialised tools. In particular, `flang-new` is not aware of various +specialised tools. In particular, `flang` is not aware of various compilation phases within the frontend (e.g. scanning, parsing or semantic -checks). It does not have to be. Conversely, the frontend driver, `flang-new +checks). It does not have to be. Conversely, the frontend driver, `flang -fc1`, needs not to be concerned with linkers or other external tools like assemblers. Nor does it need to know where to look for various systems libraries, which is usually OS and platform specific. @@ -104,7 +100,7 @@ GCC](https://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/GNU_C_Compiler_Archi In fact, Flang needs to adhere to this model in order to be able to re-use Clang's driver library. If you are more familiar with the [architecture of GFortran](https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gfortran/About-GNU-Fortran.html) -than Clang, then `flang-new` corresponds to `gfortran` and `flang-new -fc1` to +than Clang, then `flang` corresponds to `gfortran` and `flang -fc1` to `f951`. ## Compiler Driver @@ -135,7 +131,7 @@ output from one action is the input for the subsequent one. You can use the `-ccc-print-phases` flag to see the sequence of actions that the driver will create for your compiler invocation: ```bash -flang-new -ccc-print-phases -E file.f +flang -ccc-print-phases -E file.f +- 0: input, "file.f", f95-cpp-input 1: preprocessor, {0}, f95 ``` @@ -143,7 +139,7 @@ As you can see, for `-E` the driver creates only two jobs and stops immediately after preprocessing. The first job simply prepares the input. For `-c`, the pipeline of the created jobs is more complex: ```bash -flang-new -ccc-print-phases -c file.f +flang -ccc-print-phases -c file.f +- 0: input, "file.f", f95-cpp-input +- 1: preprocessor, {0}, f95 +- 2: compiler, {1}, ir @@ -158,7 +154,7 @@ command to call the frontend driver is generated (more specifically, an instance of `clang::driver::Command`). Every command is bound to an instance of `clang::driver::Tool`. For Flang we introduced a specialisation of this class: `clang::driver::Flang`. This class implements the logic to either translate or -forward compiler options to the frontend driver, `flang-new -fc1`. +forward compiler options to the frontend driver, `flang -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). @@ -232,12 +228,12 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/driver.cpp`. It can be accessed by -invoking the compiler driver, `flang-new`, with the `-fc1` flag. +invoking the compiler driver, `flang`, with the `-fc1` flag. The frontend driver will only run one action at a time. If you specify multiple action flags, only the last one will be taken into account. The default action is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other -words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only +words, `flang -fc1 ` is equivalent to `flang -fc1 -fsyntax-only `. ## Adding new Compiler Options @@ -262,8 +258,8 @@ similar semantics to your new option and start by copying that. For every new option, you will also have to define the visibility of the new option. This is controlled through the `Visibility` field. You can use the following Flang specific visibility flags to control this: - * `FlangOption` - this option will be available in the `flang-new` compiler driver, - * `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver, + * `FlangOption` - this option will be available in the `flang` compiler driver, + * `FC1Option` - this option will be available in the `flang -fc1` frontend driver, Options that are supported by clang should explicitly specify `ClangOption` in `Visibility`, and options that are only supported in Flang should not specify @@ -290,10 +286,10 @@ The parsing will depend on the semantics encoded in the TableGen definition. When adding a compiler driver option (i.e. an option that contains `FlangOption` among in it's `Visibility`) that you also intend to be understood -by the frontend, make sure that it is either forwarded to `flang-new -fc1` or +by the frontend, make sure that it is either forwarded to `flang -fc1` or translated into some other option that is accepted by the frontend driver. In the case of options that contain both `FlangOption` and `FC1Option` among its -flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is +flags, we usually just forward from `flang` to `flang -fc1`. This is then tested in `flang/test/Driver/frontend-forward.F90`. What follows is usually very dependant on the meaning of the corresponding @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use -`flang-new` as follows: +`flang` as follows: ```bash -cmake -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` @@ -353,14 +349,14 @@ where `` corresponds to the LLVM Flang version. ## Testing In LIT, we define two variables that you can use to invoke Flang's drivers: -* `%flang` is expanded as `flang-new` (i.e. the compiler driver) -* `%flang_fc1` is expanded as `flang-new -fc1` (i.e. the frontend driver) +* `%flang` is expanded as `flang` (i.e. the compiler driver) +* `%flang_fc1` is expanded as `flang -fc1` (i.e. the frontend driver) For most regression tests for the frontend, you will want to use `%flang_fc1`. In some cases, the observable behaviour will be identical regardless of whether `%flang` or `%flang_fc1` is used. However, when you are using `%flang` instead of `%flang_fc1`, the compiler driver will add extra flags to the frontend -driver invocation (i.e. `flang-new -fc1 -`). In some cases that might +driver invocation (i.e. `flang -fc1 -`). In some cases that might be exactly what you want to test. In fact, you can check these additional flags by using the `-###` compiler driver command line option. @@ -380,7 +376,7 @@ plugins. The process for using plugins includes: * [Creating a plugin](#creating-a-plugin) * [Loading and running a plugin](#loading-and-running-a-plugin) -Flang plugins are limited to `flang-new -fc1` and are currently only available / +Flang plugins are limited to `flang -fc1` and are currently only available / been tested on Linux. ### Creating a Plugin @@ -465,14 +461,14 @@ static FrontendPluginRegistry::Add X( ### Loading and Running a Plugin In order to use plugins, there are 2 command line options made available to the -frontend driver, `flang-new -fc1`: +frontend driver, `flang -fc1`: * [`-load `](#the--load-dsopath-option) for loading the dynamic shared object of the plugin * [`-plugin `](#the--plugin-name-option) for calling the registered plugin Invocation of the example plugin is done through: ```bash -flang-new -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 +flang -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 ``` Both these options are parsed in `flang/lib/Frontend/CompilerInvocation.cpp` and @@ -493,7 +489,7 @@ reports an error diagnostic and returns `nullptr`. ### Enabling In-Tree Plugins For in-tree plugins, there is the CMake flag `FLANG_PLUGIN_SUPPORT`, enabled by -default, that controls the exporting of executable symbols from `flang-new`, +default, that controls the exporting of executable symbols from `flang`, which plugins need access to. Additionally, there is the CMake flag `LLVM_BUILD_EXAMPLES`, turned off by default, that is used to control if the example programs are built. This includes plugins that are in the @@ -526,7 +522,7 @@ invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and `invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal passes at different points of the default pass pipeline. An example use of these extension point callbacks is shown in `registerDefaultInlinerPass` to invoke the -default inliner pass in `flang-new`. +default inliner pass in `flang`. ## LLVM Pass Plugins @@ -539,7 +535,7 @@ documentation for [`llvm::PassBuilder`](https://llvm.org/doxygen/classllvm_1_1PassBuilder.html) for details. -The framework to enable pass plugins in `flang-new` uses the exact same +The framework to enable pass plugins in `flang` uses the exact same machinery as that used by `clang` and thus has the same capabilities and limitations. @@ -547,7 +543,7 @@ In order to use a pass plugin, the pass(es) must be compiled into a dynamic shared object which is then loaded using the `-fpass-plugin` option. ``` -flang-new -fpass-plugin=/path/to/plugin.so +flang -fpass-plugin=/path/to/plugin.so ``` This option is available in both the compiler driver and the frontend driver. @@ -559,7 +555,7 @@ Pass extensions are similar to plugins, except that they can also be linked statically. Setting `-DLLVM_${NAME}_LINK_INTO_TOOLS` to `ON` in the cmake command turns the project into a statically linked extension. An example would be Polly, e.g., using `-DLLVM_POLLY_LINK_INTO_TOOLS=ON` would link Polly passes -into `flang-new` as built-in middle-end passes. +into `flang` as built-in middle-end passes. See the [`WritingAnLLVMNewPMPass`](https://llvm.org/docs/WritingAnLLVMNewPMPass.html#id9) diff --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md index 5b583d4f8031b8..598ef696ad14bf 100644 --- a/flang/docs/ImplementingASemanticCheck.md +++ b/flang/docs/ImplementingASemanticCheck.md @@ -68,7 +68,7 @@ of the call to `intentOutFunc()`: I also used this program to produce a parse tree for the program using the command: ```bash - flang-new -fc1 -fdebug-dump-parse-tree testfun.f90 + flang -fc1 -fdebug-dump-parse-tree testfun.f90 ``` Here's the relevant fragment of the parse tree produced by the compiler: @@ -296,7 +296,7 @@ In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation: I then built the compiler with these changes and ran it on my test program. This time, I made sure to invoke semantic checking. Here's the command I used: ```bash - flang-new -fc1 -fdebug-unparse-with-symbols testfun.f90 + flang -fc1 -fdebug-unparse-with-symbols testfun.f90 ``` This produced the output: diff --git a/flang/docs/Overview.md b/flang/docs/Overview.md index 6eba19ea3a3c0d..dfb4d89264a755 100644 --- a/flang/docs/Overview.md +++ b/flang/docs/Overview.md @@ -65,8 +65,8 @@ See [Preprocessing.md](Preprocessing.md). **Entry point:** `parser::Parsing::Prescan` **Commands:** - - `flang-new -fc1 -E src.f90` dumps the cooked character stream - - `flang-new -fc1 -fdebug-dump-provenance src.f90` dumps provenance + - `flang -fc1 -E src.f90` dumps the cooked character stream + - `flang -fc1 -fdebug-dump-provenance src.f90` dumps provenance information ### Parsing @@ -80,10 +80,10 @@ representing a syntactically correct program, rooted at the program unit. See: **Entry point:** `parser::Parsing::Parse` **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree - - `flang-new -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran - - `flang-new -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log - - `flang-new -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree + - `flang -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree + - `flang -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran + - `flang -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log + - `flang -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree ### Semantic processing @@ -121,9 +121,9 @@ In the course of semantic analysis, the compiler: At the end of semantic processing, all validation of the user's program is complete. This is the last detailed phase of analysis processing. **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis - - `flang-new -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table - - `flang-new -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table + - `flang -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis + - `flang -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table + - `flang -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table ## Lowering @@ -163,8 +163,8 @@ contain a list of evaluations. All of these contain pointers back into the parse tree. The compiler walks the PFT generating FIR. **Commands:** - - `flang-new -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree - - `flang-new -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir + - `flang -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree + - `flang -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir ### Transformation passes @@ -180,8 +180,8 @@ perform various optimizations and transformations. The final pass creates an LLVM IR representation of the program. **Commands:** - - `flang-new -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error - - `flang-new -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll + - `flang -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error + - `flang -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll ## Object code generation and linking diff --git a/flang/examples/FlangOmpReport/FlangOmpReport.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp index 9c1f304b9741e7..709c5c5d305e51 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReport.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp @@ -9,7 +9,7 @@ // all the OpenMP constructs and clauses and which line they're located on. // // The plugin may be invoked as: -// ./bin/flang-new -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report +// ./bin/flang -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report // -fopenmp // //===----------------------------------------------------------------------===// diff --git a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h index 9a70b7fbfad2b6..8ab5150cd7c812 100644 --- a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h +++ b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h @@ -67,7 +67,7 @@ struct AliasAnalysis { // end subroutine // ------------------------------------------------- // - // flang-new -fc1 -emit-fir test.f90 -o test.fir + // flang -fc1 -emit-fir test.f90 -o test.fir // // ------------------- test.fir -------------------- // fir.global @_QMtopEa : !fir.box>> diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h index 3e703de545950c..df4b21ada058fe 100644 --- a/flang/include/flang/Tools/CrossToolHelpers.h +++ b/flang/include/flang/Tools/CrossToolHelpers.h @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // A header file for containing functionallity that is used across Flang tools, // such as helper functions which apply or generate information needed accross -// tools like bbc and flang-new. +// tools like bbc and flang. //===----------------------------------------------------------------------===// #ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 05b03ba9ebdf30..18383eaafb1136 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -65,8 +65,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static bool parseShowColorsArgs(const llvm::opt::ArgList &args, bool defaultColor = true) { // Color diagnostics default to auto ("on" if terminal supports) in the - // compiler driver `flang-new` but default to off in the frontend driver - // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color. + // compiler driver `flang` but default to off in the frontend driver + // `flang -fc1`, needing an explicit OPT_fdiagnostics_color. // Support both clang's -f[no-]color-diagnostics and gcc's // -f[no-]diagnostics-colors[=never|always|auto]. enum { @@ -891,7 +891,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, } } - // Default to off for `flang-new -fc1`. + // Default to off for `flang -fc1`. res.getFrontendOpts().showColors = parseShowColorsArgs(args, /*defaultDiagColor=*/false); diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 4a52edc436e0ed..8f882bff170909 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -233,7 +233,7 @@ bool CodeGenAction::beginSourceFileAction() { llvm::SMDiagnostic err; llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx); if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) { - err.print("flang-new", llvm::errs()); + err.print("flang", llvm::errs()); unsigned diagID = ci.getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Error, "Could not parse IR"); ci.getDiagnostics().Report(diagID); diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e2cbd5112d6ea5..09ac129d3e6893 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->getFrontendOpts().showHelp) { clang::driver::getDriverOptTable().printHelp( - llvm::outs(), "flang-new -fc1 [options] file...", - "LLVM 'Flang' Compiler", + llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler", /*ShowHidden=*/false, /*ShowAllAliases=*/false, llvm::opt::Visibility(clang::driver::options::FC1Option)); return true; diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 0ad1b718d5875b..cdd2de541c6730 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -308,12 +308,12 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries" # If FortranRuntime is part of a Flang build (and not a separate build) then # add dependency to make sure that Fortran runtime library is being built after # we have the Flang compiler available. This also includes the MODULE files -# that compile when the 'flang-new' target is built. +# that compile when the 'flang' target is built. # # TODO: This is a workaround and should be updated when runtime build procedure # is changed to a regular runtime build. See discussion in PR #95388. -if (TARGET flang-new AND TARGET module_files) - add_dependencies(FortranRuntime flang-new module_files) +if (TARGET flang AND TARGET module_files) + add_dependencies(FortranRuntime flang module_files) endif() if (FLANG_CUF_RUNTIME) diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index a18a5c6519eda4..cab214c2ef4c8c 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -58,7 +58,7 @@ set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) set(FLANG_TEST_DEPENDS - flang-new + flang llvm-config FileCheck count diff --git a/flang/test/Driver/aarch64-outline-atomics.f90 b/flang/test/Driver/aarch64-outline-atomics.f90 index a1c874c20df5c7..530bfc8e962091 100644 --- a/flang/test/Driver/aarch64-outline-atomics.f90 +++ b/flang/test/Driver/aarch64-outline-atomics.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! Test that flang forwards the -moutline-atomics and -mno-outline-atomics. ! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s ! CHECK: "-target-feature" "+outline-atomics" diff --git a/flang/test/Driver/color-diagnostics-forwarding.f90 b/flang/test/Driver/color-diagnostics-forwarding.f90 index 368fa8834142ab..29061242cb0cbc 100644 --- a/flang/test/Driver/color-diagnostics-forwarding.f90 +++ b/flang/test/Driver/color-diagnostics-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards -f{no-}color-diagnostics and -! -f{no-}diagnostics-color options to flang-new -fc1 as expected. +! Test that flang forwards -f{no-}color-diagnostics and +! -f{no-}diagnostics-color options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \ ! RUN: | FileCheck %s --check-prefix=CHECK-CD diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90 index 7ec29ce7ba7abf..cefa86836abd30 100644 --- a/flang/test/Driver/compiler-options.f90 +++ b/flang/test/Driver/compiler-options.f90 @@ -1,6 +1,6 @@ ! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s -! Test communication of COMPILER_OPTIONS from flang-new to flang-new -fc1. -! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang-new{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" +! Test communication of COMPILER_OPTIONS from flang to flang -fc1. +! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" program main use ISO_FORTRAN_ENV, only: compiler_options implicit none diff --git a/flang/test/Driver/convert.f90 b/flang/test/Driver/convert.f90 index b2cf6c23efdb75..0ba31d2188cdf5 100755 --- a/flang/test/Driver/convert.f90 +++ b/flang/test/Driver/convert.f90 @@ -12,7 +12,7 @@ ! RUN: not %flang -fconvert=foobar %s 2>&1 | FileCheck %s --check-prefix=INVALID !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -emit-mlir -fconvert=unknown %s -o - | FileCheck %s --check-prefix=VALID_FC1 ! RUN: %flang_fc1 -emit-mlir -fconvert=native %s -o - | FileCheck %s --check-prefix=VALID_FC1 diff --git a/flang/test/Driver/disable-ext-name-interop.f90 b/flang/test/Driver/disable-ext-name-interop.f90 index 0c59a5b4c980f8..1ade84b996d043 100644 --- a/flang/test/Driver/disable-ext-name-interop.f90 +++ b/flang/test/Driver/disable-ext-name-interop.f90 @@ -1,4 +1,4 @@ -! Test that we can disable the ExternalNameConversion pass in flang-new. +! Test that we can disable the ExternalNameConversion pass in flang. ! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=EXTNAMES ! RUN: %flang_fc1 -S -mmlir -disable-external-name-interop %s -o - 2>&1 | FileCheck %s --check-prefix=INTNAMES diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index d1e1e1d90fe1f8..4c6aecb1c4fa7e 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -4,12 +4,12 @@ ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 -! VERSION: flang-new version +! VERSION: flang version ! VERSION-NEXT: Target: ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang-new: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/escaped-backslash.f90 b/flang/test/Driver/escaped-backslash.f90 index ad07eae24e9fab..90dd1783dd1150 100644 --- a/flang/test/Driver/escaped-backslash.f90 +++ b/flang/test/Driver/escaped-backslash.f90 @@ -1,14 +1,14 @@ ! Ensure argument -fbackslash works as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED diff --git a/flang/test/Driver/fdefault.f90 b/flang/test/Driver/fdefault.f90 index 88592bfa3e87ee..7ce45b763a240f 100644 --- a/flang/test/Driver/fdefault.f90 +++ b/flang/test/Driver/fdefault.f90 @@ -2,25 +2,25 @@ ! TODO: Add checks when actual codegen is possible for this family !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! NOOPTION: integer(4),parameter::real_kind=4_4 diff --git a/flang/test/Driver/flarge-sizes.f90 b/flang/test/Driver/flarge-sizes.f90 index 6ea5876676ed1f..6c41a03a830bfb 100644 --- a/flang/test/Driver/flarge-sizes.f90 +++ b/flang/test/Driver/flarge-sizes.f90 @@ -2,20 +2,20 @@ ! TODO: Add checks when actual codegen is possible. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE ! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 diff --git a/flang/test/Driver/frame-pointer-forwarding.f90 b/flang/test/Driver/frame-pointer-forwarding.f90 index 751494cc6a6017..9fcbd6e12f98b7 100644 --- a/flang/test/Driver/frame-pointer-forwarding.f90 +++ b/flang/test/Driver/frame-pointer-forwarding.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend +! Test that flang forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend ! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE ! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf" diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 index 35adb47b56861e..0a56a1e3710d9d 100644 --- a/flang/test/Driver/frontend-forwarding.f90 +++ b/flang/test/Driver/frontend-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards Flang frontend -! options to flang-new -fc1 as expected. +! Test that flang forwards Flang frontend +! options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \ ! RUN: -finput-charset=utf-8 \ diff --git a/flang/test/Driver/hlfir-no-hlfir-error.f90 b/flang/test/Driver/hlfir-no-hlfir-error.f90 index 2410393b6cd9c1..59f8304db5c9ab 100644 --- a/flang/test/Driver/hlfir-no-hlfir-error.f90 +++ b/flang/test/Driver/hlfir-no-hlfir-error.f90 @@ -2,12 +2,12 @@ ! options cannot be both used. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -emit-llvm -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s diff --git a/flang/test/Driver/intrinsic-module-path.f90 b/flang/test/Driver/intrinsic-module-path.f90 index 5523ed37b724cd..15d19dd83d963f 100644 --- a/flang/test/Driver/intrinsic-module-path.f90 +++ b/flang/test/Driver/intrinsic-module-path.f90 @@ -4,7 +4,7 @@ ! default one, causing a CHECKSUM error. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/large-data-threshold.f90 b/flang/test/Driver/large-data-threshold.f90 index 320566c4b2e43a..6a7eef79559d0b 100644 --- a/flang/test/Driver/large-data-threshold.f90 +++ b/flang/test/Driver/large-data-threshold.f90 @@ -7,11 +7,11 @@ ! RUN: not %flang -### -c --target=aarch64 -mcmodel=small -mlarge-data-threshold=32768 %s 2>&1 | FileCheck %s --check-prefix=NOT-SUPPORTED -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-mlarge-data-threshold=32768" -! CHECK-59000: "{{.*}}flang-new" "-fc1" +! CHECK-59000: "{{.*}}flang" "-fc1" ! CHECK-59000-SAME: "-mlarge-data-threshold=59000" -! CHECK-1M: "{{.*}}flang-new" "-fc1" +! CHECK-1M: "{{.*}}flang" "-fc1" ! CHECK-1M-SAME: "-mlarge-data-threshold=1048576" ! NO-MCMODEL: 'mlarge-data-threshold=' only applies to medium and large code models ! INVALID: error: invalid value 'nonsense' in '-mlarge-data-threshold=' diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index a51febc7009691..bad3d972e6bd6b 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang-new: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/macro-def-undef.F90 b/flang/test/Driver/macro-def-undef.F90 index 1332c6d6c02708..b13a9040833dbf 100644 --- a/flang/test/Driver/macro-def-undef.F90 +++ b/flang/test/Driver/macro-def-undef.F90 @@ -1,14 +1,14 @@ ! Ensure arguments -D and -U work as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 236325e3578f1d..51d37a718c542f 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -1,26 +1,26 @@ ! Test the behaviour of the driver when input is missing or is invalid. Note -! that with the compiler driver (flang-new), the input _has_ to be specified. +! that with the compiler driver (flang), the input _has_ to be specified. ! Indeed, the driver decides what "job/command" to create based on the input ! file's extension. No input file means that it doesn't know what to do -! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply +! (compile? preprocess? link?). The frontend driver (flang -fc1) simply ! assumes that "no explicit input == read from stdin" !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE ! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE !----------------------------------------- -! FLANG FRONTEND DRIVER (flang-new -fc1) +! FLANG FRONTEND DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang-new: error: no input files +! FLANG-NO-FILE: flang: error: no input files -! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang-new: error: no input files +! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 6c86f23f2b21fa..64ec8679abf94f 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang-new: error: cannot specify -o when generating multiple output files +! ERROR: flang: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index b0b94ab1386a74..7c51656f0001af 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -1,6 +1,6 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected. Assumes a gfx90a, aarch64, ! and sm_70 architecture, but doesn't require one to be ! installed or compiled for, just testing the appropriate ! generation of jobs are created with the correct @@ -8,8 +8,8 @@ ! Test regular -fopenmp with no offload ! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s -! CHECK-OPENMP: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" -! CHECK-OPENMP-NOT: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" +! CHECK-OPENMP-NOT: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Test regular -fopenmp with offload, and invocation filtering options ! RUN: %flang -S -### %s -o %t 2>&1 \ @@ -22,47 +22,47 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST -! OFFLOAD-HOST: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE -! OFFLOAD-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp ! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s -! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS -! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" ! OPENMP-OFFLOAD-ARGS-SAME: {{.*}}.f90" ! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fembed-offload-object={{.*}}.out" {{.*}}.bc" @@ -77,7 +77,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-threads-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS -! CHECK-THREADS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" +! CHECK-THREADS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -89,7 +89,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-teams-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS -! CHECK-TEAMS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" +! CHECK-TEAMS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -101,7 +101,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-nested-parallelism \ ! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR -! CHECK-NEST-PAR: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" +! CHECK-NEST-PAR: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -113,7 +113,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE -! CHECK-THREAD-STATE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" +! CHECK-THREAD-STATE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -125,7 +125,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" +! CHECK-TARGET-DEBUG: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -137,7 +137,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" +! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -153,7 +153,7 @@ ! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL -! CHECK-RTL-ALL: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" +! CHECK-RTL-ALL: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" ! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism" ! CHECK-RTL-ALL: {{.*}}.f90" @@ -167,7 +167,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-version=45 \ ! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION -! CHECK-OPENMP-VERSION: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" +! CHECK-OPENMP-VERSION: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" ! Test diagnostic error when host IR file is non-existent ! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \ @@ -187,7 +187,7 @@ ! RUN: --target=aarch64-unknown-linux-gnu \ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-NO-OFFLOAD -! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-NO-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! Test -fopenmp-force-usm option with offload @@ -196,16 +196,16 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-OFFLOAD -! FORCE-USM-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" -! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \ ! RUN: --offload-arch=gfx900 \ ! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ ! RUN: | FileCheck --check-prefix=MLINK-BUILTIN-BITCODE %s -! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! MLINK-BUILTIN-BITCODE-SAME: "-mlink-builtin-bitcode" {{.*Inputs.*rocm.*amdgcn.*bitcode.*}}oclc_isa_version_900.bc ! Test that the -fopenmp-targets option is added to host compilation invocations @@ -219,9 +219,9 @@ ! RUN: --target=x86_64-unknown-linux-gnu -nogpulib \ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-TARGETS -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" -! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-TARGETS-NOT: -fopenmp-targets -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" diff --git a/flang/test/Driver/predefined-macros-compiler-version.F90 b/flang/test/Driver/predefined-macros-compiler-version.F90 index 823a730f96845a..f6924479281562 100644 --- a/flang/test/Driver/predefined-macros-compiler-version.F90 +++ b/flang/test/Driver/predefined-macros-compiler-version.F90 @@ -1,12 +1,12 @@ ! Check that the driver correctly defines macros with the compiler version !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case diff --git a/flang/test/Driver/std2018-wrong.f90 b/flang/test/Driver/std2018-wrong.f90 index 27ccc76bd39aad..93ba153d75f7f9 100644 --- a/flang/test/Driver/std2018-wrong.f90 +++ b/flang/test/Driver/std2018-wrong.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG diff --git a/flang/test/Driver/std2018.f90 b/flang/test/Driver/std2018.f90 index cf461cf89e4e19..1727f92127b711 100644 --- a/flang/test/Driver/std2018.f90 +++ b/flang/test/Driver/std2018.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03 index 6e03f9f43fc602..1d850305cd040e 100644 --- a/flang/test/Driver/supported-suffices/f03-suffix.f03 +++ b/flang/test/Driver/supported-suffices/f03-suffix.f03 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f03 end program f03 diff --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08 index d5bcf4ce1de1cc..2b31e4c21876ae 100644 --- a/flang/test/Driver/supported-suffices/f08-suffix.f08 +++ b/flang/test/Driver/supported-suffices/f08-suffix.f08 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f08 end program f08 diff --git a/flang/test/Driver/use-module-error.f90 b/flang/test/Driver/use-module-error.f90 index 42d6650621c8c8..67335f61626817 100644 --- a/flang/test/Driver/use-module-error.f90 +++ b/flang/test/Driver/use-module-error.f90 @@ -1,14 +1,14 @@ ! Ensure that multiple module directories are not allowed !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE diff --git a/flang/test/Driver/use-module.f90 b/flang/test/Driver/use-module.f90 index 775c0424715883..2c3a38043fe16e 100644 --- a/flang/test/Driver/use-module.f90 +++ b/flang/test/Driver/use-module.f90 @@ -1,7 +1,7 @@ ! Checks that module search directories specified with `-J/-module-dir` and `-I` are handled correctly !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty @@ -16,7 +16,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty diff --git a/flang/test/Driver/version-loops.f90 b/flang/test/Driver/version-loops.f90 index b0fa01d572512a..d206393a04f486 100644 --- a/flang/test/Driver/version-loops.f90 +++ b/flang/test/Driver/version-loops.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards the -f{no-,}version-loops-for-stride -! options correctly to flang-new -fc1 for different variants of optimisation +! Test that flang forwards the -f{no-,}version-loops-for-stride +! options correctly to flang -fc1 for different variants of optimisation ! and explicit flags. ! RUN: %flang -### %s -o %t 2>&1 -O3 \ @@ -23,32 +23,32 @@ ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \ ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-fversion-loops-for-stride" ! CHECK-SAME: "-O3" -! CHECK-O2: "{{.*}}flang-new" "-fc1" +! CHECK-O2: "{{.*}}flang" "-fc1" ! CHECK-O2-NOT: "-fversion-loops-for-stride" ! CHECK-O2-SAME: "-O2" -! CHECK-O2-with: "{{.*}}flang-new" "-fc1" +! CHECK-O2-with: "{{.*}}flang" "-fc1" ! CHECK-O2-with-SAME: "-fversion-loops-for-stride" ! CHECK-O2-with-SAME: "-O2" -! CHECK-O4: "{{.*}}flang-new" "-fc1" +! CHECK-O4: "{{.*}}flang" "-fc1" ! CHECK-O4-SAME: "-fversion-loops-for-stride" ! CHECK-O4-SAME: "-O3" -! CHECK-Ofast: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast: "{{.*}}flang" "-fc1" ! CHECK-Ofast-SAME: "-ffast-math" ! CHECK-Ofast-SAME: "-fversion-loops-for-stride" ! CHECK-Ofast-SAME: "-O3" -! CHECK-Ofast-no: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast-no: "{{.*}}flang" "-fc1" ! CHECK-Ofast-no-SAME: "-ffast-math" ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride" ! CHECK-Ofast-no-SAME: "-O3" -! CHECK-O3-no: "{{.*}}flang-new" "-fc1" +! CHECK-O3-no: "{{.*}}flang" "-fc1" ! CHECK-O3-no-NOT: "-fversion-loops-for-stride" ! CHECK-O3-no-SAME: "-O3" diff --git a/flang/test/Driver/wextra-ok.f90 b/flang/test/Driver/wextra-ok.f90 index 6a38d9481a36b7..441029aa0af276 100644 --- a/flang/test/Driver/wextra-ok.f90 +++ b/flang/test/Driver/wextra-ok.f90 @@ -1,4 +1,4 @@ -! Ensure that supplying -Wextra into flang-new does not raise error +! Ensure that supplying -Wextra into flang does not raise error ! The first check should be changed if -Wextra is implemented ! RUN: %flang -std=f2018 -Wextra %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-OK diff --git a/flang/test/HLFIR/hlfir-flags.f90 b/flang/test/HLFIR/hlfir-flags.f90 index b383a79d12c27b..0b1e80b1e3f636 100644 --- a/flang/test/HLFIR/hlfir-flags.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,4 +1,4 @@ -! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang-new), and +! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang), and ! -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s diff --git a/flang/test/Lower/Intrinsics/command_argument_count.f90 b/flang/test/Lower/Intrinsics/command_argument_count.f90 index 0cf92d4444db98..a30b27d664fc0c 100644 --- a/flang/test/Lower/Intrinsics/command_argument_count.f90 +++ b/flang/test/Lower/Intrinsics/command_argument_count.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver -! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s +! bbc doesn't have a way to set the default kinds so we use flang driver +! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s ! CHECK-LABEL: argument_count_test subroutine argument_count_test() diff --git a/flang/test/Lower/Intrinsics/exit.f90 b/flang/test/Lower/Intrinsics/exit.f90 index c3110fcbec2b5a..bd551f7318a84a 100644 --- a/flang/test/Lower/Intrinsics/exit.f90 +++ b/flang/test/Lower/Intrinsics/exit.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver +! bbc doesn't have a way to set the default kinds so we use flang driver ! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s ! CHECK-LABEL: func @_QPexit_test1() { diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 index f9ab01881d250d..9b864c9a9849c3 100644 --- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 +++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: ieee_is_normal_f16 subroutine ieee_is_normal_f16(r) diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90 index 700b2d1a67c656..62b98c8ea98bee 100644 --- a/flang/test/Lower/Intrinsics/isnan.f90 +++ b/flang/test/Lower/Intrinsics/isnan.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: isnan_f32 subroutine isnan_f32(r) diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90 index ac18e59033a6b6..781ef8296a2b7d 100644 --- a/flang/test/Lower/Intrinsics/modulo.f90 +++ b/flang/test/Lower/Intrinsics/modulo.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL -! RUN: flang-new -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL +! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL ! ALL-LABEL: func @_QPmodulo_testr( ! ALL-SAME: %[[arg0:.*]]: !fir.ref{{.*}}, %[[arg1:.*]]: !fir.ref{{.*}}, %[[arg2:.*]]: !fir.ref{{.*}}) { diff --git a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 index f02884e5e92f38..425ccbc5dd56c5 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP allocate Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s program main integer :: x, y diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 index 3be61a1700ced3..7a7d28db8d6f5a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare reduction Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine declare_red() integer :: my_var diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 index c6a0a8f2cd0d22..be1ac2db5dfa4a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare simd Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine sub(x, y) real, intent(inout) :: x, y diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 index 62bc247a1456a1..bc5baf4e1cf604 100644 --- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 +++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 @@ -1,7 +1,7 @@ ! This test checks lowering of `LASTPRIVATE` clause for scalar types. ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s !CHECK: func @_QPlastprivate_character(%[[ARG1:.*]]: !fir.boxchar<1>{{.*}}) { !CHECK-DAG: %[[ARG1_UNBOX:.*]]:2 = fir.unboxchar diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 index 32caac39778dee..99c521406a7775 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(byref @add_reduction_byref_i32 diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 index fdedbb06160761..cfeb5de83f4e82 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(@add_reduction_i32 diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 4acbc0606d1977..f43234fb125b7e 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -132,13 +132,13 @@ tools = [ ToolSubst( "%flang", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=isysroot_flag, unresolved="fatal", ), ToolSubst( "%flang_fc1", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=["-fc1"], unresolved="fatal", ), diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 9d7b8633958cb7..4362fcf0537616 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set(module_objects "") # Create module files directly from the top-level module source directory. -# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was +# If CMAKE_CROSSCOMPILING, then the newly built flang executable was # cross compiled, and thus can't be executed on the build system and thus # can't be used for generating module files. if (NOT CMAKE_CROSSCOMPILING) @@ -115,9 +115,9 @@ if (NOT CMAKE_CROSSCOMPILING) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${FLANG_SOURCE_DIR}/module/${filename}.f90 - DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) list(APPEND MODULE_FILES ${base}.mod) install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") @@ -142,9 +142,9 @@ if (NOT CMAKE_CROSSCOMPILING) set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib) add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 - DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} + DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} ) add_custom_command(OUTPUT ${base}.f18.mod DEPENDS ${base}.mod diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 9f33cdfe3fa90f..615c673374faf4 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS TargetParser ) -add_flang_tool(flang-new +add_flang_tool(flang driver.cpp fc1_main.cpp ) -target_link_libraries(flang-new +target_link_libraries(flang PRIVATE flangFrontend flangFrontendTool ) -clang_target_link_libraries(flang-new +clang_target_link_libraries(flang PRIVATE clangDriver clangBasic @@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) -# Enable support for plugins, which need access to symbols from flang-new +# Enable support for plugins, which need access to symbols from flang if(FLANG_PLUGIN_SUPPORT) - export_executable_symbols_for_plugins(flang-new) + export_executable_symbols_for_plugins(flang) endif() -install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 52136df10c0b02..603aab4205836c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -95,7 +95,7 @@ int main(int argc, const char **argv) { llvm::StringSaver saver(a); ExpandResponseFiles(saver, args); - // Check if flang-new is in the frontend mode + // Check if flang is in the frontend mode auto firstArg = std::find_if(args.begin() + 1, args.end(), [](const char *a) { return a != nullptr; }); if (firstArg != args.end()) { @@ -104,7 +104,7 @@ int main(int argc, const char **argv) { << "Valid tools include '-fc1'.\n"; return 1; } - // Call flang-new frontend + // Call flang frontend if (llvm::StringRef(args[1]).starts_with("-fc1")) { return executeFC1Tool(args); } @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { // Set the environment variable, FLANG_COMPILER_OPTIONS_STRING, to contain all // the compiler options. This is intended for the frontend driver, - // flang-new -fc1, to enable the implementation of the COMPILER_OPTIONS + // flang -fc1, to enable the implementation of the COMPILER_OPTIONS // intrinsic. To this end, the frontend driver requires the list of the // original compiler options, which is not available through other means. // TODO: This way of passing information between the compiler and frontend diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index d948b7eb39b39c..9da1f926817a8b 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -504,15 +504,15 @@ if(build_runtimes) if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES) if (${LLVM_TOOL_FLANG_BUILD}) - message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new") - set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new") + message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang") + set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang") set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang") # TODO: This is a workaround until flang becomes a first-class project - # in llvm/CMakeList.txt. Until then, this line ensures that flang-new is - # built before "openmp" is built as a runtime project. Besides "flang-new" + # in llvm/CMakeList.txt. Until then, this line ensures that flang is + # built before "openmp" is built as a runtime project. Besides "flang" # to build the compiler, we also need to add "module_files" to make sure # that all .mod files are also properly build. - list(APPEND extra_deps "flang-new" "module_files") + list(APPEND extra_deps "flang" "module_files") endif() foreach(dep opt llvm-link llvm-extract clang clang-offload-packager) if(TARGET ${dep}) diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 9ffe8f56b76e67..9b771d1116ee38 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -89,9 +89,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 3b4259dfa380e8..c206386fa6b614 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -69,9 +69,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found >From b71c1d519cc61a751268b1ccda3fc59a966bab96 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 26 Sep 2024 10:39:53 -0500 Subject: [PATCH 2/5] [flang][driver] restore flang-new as symlink Restore flang-new as a symlink to flang for backwards compatibility Co-authored-by: H. Vetinari Co-authored-by: Andrzej Warzynski --- clang/lib/Driver/ToolChain.cpp | 3 +++ flang/tools/flang-driver/CMakeLists.txt | 4 ++++ flang/tools/flang-driver/driver.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 16f9b629fc538c..c9f3dbd7707b77 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -381,6 +381,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { {"cl", "--driver-mode=cl"}, {"++", "--driver-mode=g++"}, {"flang", "--driver-mode=flang"}, + // For backwards compatibility, we create a symlink for `flang` called + // `flang-new`. This will be removed in the future. + {"flang-new", "--driver-mode=flang"}, {"clang-dxc", "--driver-mode=dxc"}, }; diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 615c673374faf4..063acdd7dfe57c 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -36,3 +36,7 @@ if(FLANG_PLUGIN_SUPPORT) endif() install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") + +# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang" +# is a widely adopted name. +add_flang_symlink(flang-new flang) diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 603aab4205836c..ed52988feaa59c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -88,7 +88,8 @@ int main(int argc, const char **argv) { llvm::InitLLVM x(argc, argv); llvm::SmallVector args(argv, argv + argc); - clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang"); + clang::driver::ParsedClangName targetandMode = + clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]); std::string driverPath = getExecutablePath(args[0]); llvm::BumpPtrAllocator a; >From 443c951f8e0458e8b011424fad6a2e4b40b63144 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 30 Sep 2024 10:16:59 -0500 Subject: [PATCH 3/5] [flang][driver] add version to flang executable --- flang/tools/flang-driver/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 063acdd7dfe57c..9a89a6185a3291 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -28,6 +28,12 @@ clang_target_link_libraries(flang clangBasic ) +# This creates the executable with a version appended +# and creates a symlink to it without the version +if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows + set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION}) +endif() + option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) # Enable support for plugins, which need access to symbols from flang >From 27ae40d86f235890d109ca88682dd0caba0d2c93 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 3 Oct 2024 14:12:35 -0700 Subject: [PATCH 4/5] [flang][driver] add warning when using openmp --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 3 +++ clang/include/clang/Basic/DiagnosticGroups.td | 4 ++++ clang/lib/Driver/ToolChains/Flang.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 97573fcf20c1fb..68722ad9633120 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning< def warn_drv_unsupported_openmp_library : Warning< "the library '%0=%1' is not supported, OpenMP will not be enabled">, InGroup; +def warn_openmp_experimental : Warning< + "OpenMP support in flang is still experimental">, + InGroup; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 7d81bdf827ea0c..bfa065f018f8d8 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1582,3 +1582,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">; // Warnings about using the non-standard extension having an explicit specialization // with a storage class specifier. def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">; + +// A warning for options that enable a feature that is not yet complete +def ExperimentalOption : DiagGroup<"experimental-option">; + diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 1ca12ff81389a3..19b43594b00815 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); // FIXME: Clang supports a whole bunch more flags here. break; >From d8f95da5712a7d03a935c8b38f06d373c21f7a1f Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 06:27:05 -0700 Subject: [PATCH 5/5] [flang][doc] update note about CMake support --- flang/docs/FlangDriver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 47cf078cf2d0d4..23cbab30ee903e 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -335,7 +335,7 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a +(CMake 3.28.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use `flang` as follows: ```bash From openmp-commits at lists.llvm.org Fri Oct 4 06:28:37 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Fri, 04 Oct 2024 06:28:37 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66ffed85.630a0220.37b37e.b13f@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a ---------------- everythingfunctional wrote: So, sounds like support is there in CMake, so I've updated the note and the identified version. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Fri Oct 4 07:11:38 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Fri, 04 Oct 2024 07:11:38 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <66fff79a.050a0220.86023.22d0@mx.google.com> https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From 649a73478c78389560042030a9717a05e8e338a8 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/6] [flang][driver] rename flang-new to flang --- .github/workflows/release-binaries.yml | 2 +- clang/include/clang/Driver/Options.td | 4 +- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Driver/ToolChains/Flang.cpp | 6 +- clang/test/Driver/flang/flang.f90 | 2 +- clang/test/Driver/flang/flang_ucase.F90 | 2 +- .../Driver/flang/multiple-inputs-mixed.f90 | 2 +- clang/test/Driver/flang/multiple-inputs.f90 | 4 +- flang/docs/FlangDriver.md | 76 +++++++++---------- flang/docs/ImplementingASemanticCheck.md | 4 +- flang/docs/Overview.md | 26 +++---- .../FlangOmpReport/FlangOmpReport.cpp | 2 +- .../flang/Optimizer/Analysis/AliasAnalysis.h | 2 +- flang/include/flang/Tools/CrossToolHelpers.h | 2 +- flang/lib/Frontend/CompilerInvocation.cpp | 6 +- flang/lib/Frontend/FrontendActions.cpp | 2 +- .../ExecuteCompilerInvocation.cpp | 3 +- flang/runtime/CMakeLists.txt | 6 +- flang/test/CMakeLists.txt | 2 +- flang/test/Driver/aarch64-outline-atomics.f90 | 2 +- .../Driver/color-diagnostics-forwarding.f90 | 4 +- flang/test/Driver/compiler-options.f90 | 4 +- flang/test/Driver/convert.f90 | 2 +- .../test/Driver/disable-ext-name-interop.f90 | 2 +- flang/test/Driver/driver-version.f90 | 4 +- flang/test/Driver/escaped-backslash.f90 | 4 +- flang/test/Driver/fdefault.f90 | 28 +++---- flang/test/Driver/flarge-sizes.f90 | 20 ++--- .../test/Driver/frame-pointer-forwarding.f90 | 2 +- flang/test/Driver/frontend-forwarding.f90 | 4 +- flang/test/Driver/hlfir-no-hlfir-error.f90 | 4 +- flang/test/Driver/intrinsic-module-path.f90 | 2 +- flang/test/Driver/large-data-threshold.f90 | 6 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/macro-def-undef.F90 | 4 +- flang/test/Driver/missing-input.f90 | 14 ++-- flang/test/Driver/multiple-input-files.f90 | 2 +- flang/test/Driver/omp-driver-offload.f90 | 66 ++++++++-------- .../predefined-macros-compiler-version.F90 | 4 +- flang/test/Driver/std2018-wrong.f90 | 2 +- flang/test/Driver/std2018.f90 | 2 +- .../Driver/supported-suffices/f03-suffix.f03 | 2 +- .../Driver/supported-suffices/f08-suffix.f08 | 2 +- flang/test/Driver/use-module-error.f90 | 4 +- flang/test/Driver/use-module.f90 | 4 +- flang/test/Driver/version-loops.f90 | 18 ++--- flang/test/Driver/wextra-ok.f90 | 2 +- flang/test/HLFIR/hlfir-flags.f90 | 2 +- .../Intrinsics/command_argument_count.f90 | 4 +- flang/test/Lower/Intrinsics/exit.f90 | 2 +- .../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +- flang/test/Lower/Intrinsics/isnan.f90 | 2 +- flang/test/Lower/Intrinsics/modulo.f90 | 2 +- .../OpenMP/Todo/omp-declarative-allocate.f90 | 2 +- .../OpenMP/Todo/omp-declare-reduction.f90 | 2 +- .../Lower/OpenMP/Todo/omp-declare-simd.f90 | 2 +- .../parallel-lastprivate-clause-scalar.f90 | 2 +- .../parallel-wsloop-reduction-byref.f90 | 2 +- .../OpenMP/parallel-wsloop-reduction.f90 | 2 +- flang/test/lit.cfg.py | 4 +- flang/tools/f18/CMakeLists.txt | 10 +-- flang/tools/flang-driver/CMakeLists.txt | 12 +-- flang/tools/flang-driver/driver.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 10 +-- offload/CMakeLists.txt | 4 +- openmp/CMakeLists.txt | 4 +- 66 files changed, 220 insertions(+), 227 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 925912df6843e4..6073ebac9e6c2c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -328,7 +328,7 @@ jobs: run: | # Build some of the mlir tools that take a long time to link if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc fi ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \ mlir-bytecode-parser-fuzzer \ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 932cf13edab53d..4a45a825da8fa1 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6071,7 +6071,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; //===----------------------------------------------------------------------===// -// pie/pic options (clang + flang-new) +// pie/pic options (clang + flang) //===----------------------------------------------------------------------===// let Visibility = [ClangOption, FlangOption] in { @@ -6087,7 +6087,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group; } // let Vis = [Default, FlangOption] //===----------------------------------------------------------------------===// -// Target Options (clang + flang-new) +// Target Options (clang + flang) //===----------------------------------------------------------------------===// let Flags = [TargetSpecific] in { let Visibility = [ClangOption, FlangOption] in { diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index d0c8bdba0ede95..4243ee006c1553 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2021,7 +2021,7 @@ void Driver::PrintHelp(bool ShowHidden) const { void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { if (IsFlangMode()) { - OS << getClangToolFullVersion("flang-new") << '\n'; + OS << getClangToolFullVersion("flang") << '\n'; } else { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 98350690f8d20e..1ca12ff81389a3 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -881,14 +881,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); - // TODO: Replace flang-new with flang once the new driver replaces the - // throwaway driver - const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC)); + const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs, Output)); } -Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {} +Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {} diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 index ad4a3a3b6bd44d..b52977ee66d7b0 100644 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 index e89c053b327bc9..88aedc39fb94a7 100644 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/clang/test/Driver/flang/multiple-inputs-mixed.f90 index 2395dbecf1fe92..98d8cab00bdfdb 100644 --- a/clang/test/Driver/flang/multiple-inputs-mixed.f90 +++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90 @@ -1,7 +1,7 @@ ! Check that flang can handle mixed C and fortran inputs. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c" diff --git a/clang/test/Driver/flang/multiple-inputs.f90 b/clang/test/Driver/flang/multiple-inputs.f90 index ada999e927a6a0..3c0f22e5d3e508 100644 --- a/clang/test/Driver/flang/multiple-inputs.f90 +++ b/clang/test/Driver/flang/multiple-inputs.f90 @@ -1,7 +1,7 @@ ! Check that flang driver can handle multiple inputs at once. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90" diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 815c26a28dfdfa..47cf078cf2d0d4 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: -* the compiler driver, `flang-new` -* the frontend driver, `flang-new -fc1` - -> **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the -> diagrams reflect the final design that we are still working towards. +* the compiler driver, `flang` +* the frontend driver, `flang -fc1` The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering and linking). For frontend specific tasks, the compiler driver creates a -Fortran compilation job and delegates it to `flang-new -fc1`, the frontend +Fortran compilation job and delegates it to `flang -fc1`, the frontend driver. For linking, it creates a linker job and calls an external linker (e.g. LLVM's [`lld`](https://lld.llvm.org/)). It can also call other tools such as external assemblers (e.g. [`as`](https://www.gnu.org/software/binutils/)). In @@ -47,7 +43,7 @@ frontend. It uses MLIR and LLVM for code-generation and can be viewed as a driver for Flang, LLVM and MLIR libraries. Contrary to the compiler driver, it is not capable of calling any external tools (including linkers). It is aware of all the frontend internals that are "hidden" from the compiler driver. It -accepts many frontend-specific options not available in `flang-new` and as such +accepts many frontend-specific options not available in `flang` and as such it provides a finer control over the frontend. Note that this tool is mostly intended for Flang developers. In particular, there are no guarantees about the stability of its interface and compiler developers can use it to experiment @@ -62,30 +58,30 @@ frontend specific flag from the _compiler_ directly to the _frontend_ driver, e.g.: ```bash -flang-new -Xflang -fdebug-dump-parse-tree input.f95 +flang -Xflang -fdebug-dump-parse-tree input.f95 ``` -In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang-new +In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang -fc1`. Without the forwarding flag, `-Xflang`, you would see the following warning: ```bash -flang-new: warning: argument unused during compilation: +flang: warning: argument unused during compilation: ``` -As `-fdebug-dump-parse-tree` is only supported by `flang-new -fc1`, `flang-new` +As `-fdebug-dump-parse-tree` is only supported by `flang -fc1`, `flang` will ignore it when used without `Xflang`. ## Why Do We Need Two Drivers? -As hinted above, `flang-new` and `flang-new -fc1` are two separate tools. The -fact that these tools are accessed through one binary, `flang-new`, is just an +As hinted above, `flang` and `flang -fc1` are two separate tools. The +fact that these tools are accessed through one binary, `flang`, is just an implementation detail. Each tool has a separate list of options, albeit defined in the same file: `clang/include/clang/Driver/Options.td`. The separation helps us split various tasks and allows us to implement more -specialised tools. In particular, `flang-new` is not aware of various +specialised tools. In particular, `flang` is not aware of various compilation phases within the frontend (e.g. scanning, parsing or semantic -checks). It does not have to be. Conversely, the frontend driver, `flang-new +checks). It does not have to be. Conversely, the frontend driver, `flang -fc1`, needs not to be concerned with linkers or other external tools like assemblers. Nor does it need to know where to look for various systems libraries, which is usually OS and platform specific. @@ -104,7 +100,7 @@ GCC](https://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/GNU_C_Compiler_Archi In fact, Flang needs to adhere to this model in order to be able to re-use Clang's driver library. If you are more familiar with the [architecture of GFortran](https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gfortran/About-GNU-Fortran.html) -than Clang, then `flang-new` corresponds to `gfortran` and `flang-new -fc1` to +than Clang, then `flang` corresponds to `gfortran` and `flang -fc1` to `f951`. ## Compiler Driver @@ -135,7 +131,7 @@ output from one action is the input for the subsequent one. You can use the `-ccc-print-phases` flag to see the sequence of actions that the driver will create for your compiler invocation: ```bash -flang-new -ccc-print-phases -E file.f +flang -ccc-print-phases -E file.f +- 0: input, "file.f", f95-cpp-input 1: preprocessor, {0}, f95 ``` @@ -143,7 +139,7 @@ As you can see, for `-E` the driver creates only two jobs and stops immediately after preprocessing. The first job simply prepares the input. For `-c`, the pipeline of the created jobs is more complex: ```bash -flang-new -ccc-print-phases -c file.f +flang -ccc-print-phases -c file.f +- 0: input, "file.f", f95-cpp-input +- 1: preprocessor, {0}, f95 +- 2: compiler, {1}, ir @@ -158,7 +154,7 @@ command to call the frontend driver is generated (more specifically, an instance of `clang::driver::Command`). Every command is bound to an instance of `clang::driver::Tool`. For Flang we introduced a specialisation of this class: `clang::driver::Flang`. This class implements the logic to either translate or -forward compiler options to the frontend driver, `flang-new -fc1`. +forward compiler options to the frontend driver, `flang -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). @@ -232,12 +228,12 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/driver.cpp`. It can be accessed by -invoking the compiler driver, `flang-new`, with the `-fc1` flag. +invoking the compiler driver, `flang`, with the `-fc1` flag. The frontend driver will only run one action at a time. If you specify multiple action flags, only the last one will be taken into account. The default action is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other -words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only +words, `flang -fc1 ` is equivalent to `flang -fc1 -fsyntax-only `. ## Adding new Compiler Options @@ -262,8 +258,8 @@ similar semantics to your new option and start by copying that. For every new option, you will also have to define the visibility of the new option. This is controlled through the `Visibility` field. You can use the following Flang specific visibility flags to control this: - * `FlangOption` - this option will be available in the `flang-new` compiler driver, - * `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver, + * `FlangOption` - this option will be available in the `flang` compiler driver, + * `FC1Option` - this option will be available in the `flang -fc1` frontend driver, Options that are supported by clang should explicitly specify `ClangOption` in `Visibility`, and options that are only supported in Flang should not specify @@ -290,10 +286,10 @@ The parsing will depend on the semantics encoded in the TableGen definition. When adding a compiler driver option (i.e. an option that contains `FlangOption` among in it's `Visibility`) that you also intend to be understood -by the frontend, make sure that it is either forwarded to `flang-new -fc1` or +by the frontend, make sure that it is either forwarded to `flang -fc1` or translated into some other option that is accepted by the frontend driver. In the case of options that contain both `FlangOption` and `FC1Option` among its -flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is +flags, we usually just forward from `flang` to `flang -fc1`. This is then tested in `flang/test/Driver/frontend-forward.F90`. What follows is usually very dependant on the meaning of the corresponding @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use -`flang-new` as follows: +`flang` as follows: ```bash -cmake -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` @@ -353,14 +349,14 @@ where `` corresponds to the LLVM Flang version. ## Testing In LIT, we define two variables that you can use to invoke Flang's drivers: -* `%flang` is expanded as `flang-new` (i.e. the compiler driver) -* `%flang_fc1` is expanded as `flang-new -fc1` (i.e. the frontend driver) +* `%flang` is expanded as `flang` (i.e. the compiler driver) +* `%flang_fc1` is expanded as `flang -fc1` (i.e. the frontend driver) For most regression tests for the frontend, you will want to use `%flang_fc1`. In some cases, the observable behaviour will be identical regardless of whether `%flang` or `%flang_fc1` is used. However, when you are using `%flang` instead of `%flang_fc1`, the compiler driver will add extra flags to the frontend -driver invocation (i.e. `flang-new -fc1 -`). In some cases that might +driver invocation (i.e. `flang -fc1 -`). In some cases that might be exactly what you want to test. In fact, you can check these additional flags by using the `-###` compiler driver command line option. @@ -380,7 +376,7 @@ plugins. The process for using plugins includes: * [Creating a plugin](#creating-a-plugin) * [Loading and running a plugin](#loading-and-running-a-plugin) -Flang plugins are limited to `flang-new -fc1` and are currently only available / +Flang plugins are limited to `flang -fc1` and are currently only available / been tested on Linux. ### Creating a Plugin @@ -465,14 +461,14 @@ static FrontendPluginRegistry::Add X( ### Loading and Running a Plugin In order to use plugins, there are 2 command line options made available to the -frontend driver, `flang-new -fc1`: +frontend driver, `flang -fc1`: * [`-load `](#the--load-dsopath-option) for loading the dynamic shared object of the plugin * [`-plugin `](#the--plugin-name-option) for calling the registered plugin Invocation of the example plugin is done through: ```bash -flang-new -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 +flang -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 ``` Both these options are parsed in `flang/lib/Frontend/CompilerInvocation.cpp` and @@ -493,7 +489,7 @@ reports an error diagnostic and returns `nullptr`. ### Enabling In-Tree Plugins For in-tree plugins, there is the CMake flag `FLANG_PLUGIN_SUPPORT`, enabled by -default, that controls the exporting of executable symbols from `flang-new`, +default, that controls the exporting of executable symbols from `flang`, which plugins need access to. Additionally, there is the CMake flag `LLVM_BUILD_EXAMPLES`, turned off by default, that is used to control if the example programs are built. This includes plugins that are in the @@ -526,7 +522,7 @@ invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and `invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal passes at different points of the default pass pipeline. An example use of these extension point callbacks is shown in `registerDefaultInlinerPass` to invoke the -default inliner pass in `flang-new`. +default inliner pass in `flang`. ## LLVM Pass Plugins @@ -539,7 +535,7 @@ documentation for [`llvm::PassBuilder`](https://llvm.org/doxygen/classllvm_1_1PassBuilder.html) for details. -The framework to enable pass plugins in `flang-new` uses the exact same +The framework to enable pass plugins in `flang` uses the exact same machinery as that used by `clang` and thus has the same capabilities and limitations. @@ -547,7 +543,7 @@ In order to use a pass plugin, the pass(es) must be compiled into a dynamic shared object which is then loaded using the `-fpass-plugin` option. ``` -flang-new -fpass-plugin=/path/to/plugin.so +flang -fpass-plugin=/path/to/plugin.so ``` This option is available in both the compiler driver and the frontend driver. @@ -559,7 +555,7 @@ Pass extensions are similar to plugins, except that they can also be linked statically. Setting `-DLLVM_${NAME}_LINK_INTO_TOOLS` to `ON` in the cmake command turns the project into a statically linked extension. An example would be Polly, e.g., using `-DLLVM_POLLY_LINK_INTO_TOOLS=ON` would link Polly passes -into `flang-new` as built-in middle-end passes. +into `flang` as built-in middle-end passes. See the [`WritingAnLLVMNewPMPass`](https://llvm.org/docs/WritingAnLLVMNewPMPass.html#id9) diff --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md index 5b583d4f8031b8..598ef696ad14bf 100644 --- a/flang/docs/ImplementingASemanticCheck.md +++ b/flang/docs/ImplementingASemanticCheck.md @@ -68,7 +68,7 @@ of the call to `intentOutFunc()`: I also used this program to produce a parse tree for the program using the command: ```bash - flang-new -fc1 -fdebug-dump-parse-tree testfun.f90 + flang -fc1 -fdebug-dump-parse-tree testfun.f90 ``` Here's the relevant fragment of the parse tree produced by the compiler: @@ -296,7 +296,7 @@ In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation: I then built the compiler with these changes and ran it on my test program. This time, I made sure to invoke semantic checking. Here's the command I used: ```bash - flang-new -fc1 -fdebug-unparse-with-symbols testfun.f90 + flang -fc1 -fdebug-unparse-with-symbols testfun.f90 ``` This produced the output: diff --git a/flang/docs/Overview.md b/flang/docs/Overview.md index 6eba19ea3a3c0d..dfb4d89264a755 100644 --- a/flang/docs/Overview.md +++ b/flang/docs/Overview.md @@ -65,8 +65,8 @@ See [Preprocessing.md](Preprocessing.md). **Entry point:** `parser::Parsing::Prescan` **Commands:** - - `flang-new -fc1 -E src.f90` dumps the cooked character stream - - `flang-new -fc1 -fdebug-dump-provenance src.f90` dumps provenance + - `flang -fc1 -E src.f90` dumps the cooked character stream + - `flang -fc1 -fdebug-dump-provenance src.f90` dumps provenance information ### Parsing @@ -80,10 +80,10 @@ representing a syntactically correct program, rooted at the program unit. See: **Entry point:** `parser::Parsing::Parse` **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree - - `flang-new -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran - - `flang-new -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log - - `flang-new -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree + - `flang -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree + - `flang -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran + - `flang -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log + - `flang -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree ### Semantic processing @@ -121,9 +121,9 @@ In the course of semantic analysis, the compiler: At the end of semantic processing, all validation of the user's program is complete. This is the last detailed phase of analysis processing. **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis - - `flang-new -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table - - `flang-new -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table + - `flang -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis + - `flang -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table + - `flang -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table ## Lowering @@ -163,8 +163,8 @@ contain a list of evaluations. All of these contain pointers back into the parse tree. The compiler walks the PFT generating FIR. **Commands:** - - `flang-new -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree - - `flang-new -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir + - `flang -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree + - `flang -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir ### Transformation passes @@ -180,8 +180,8 @@ perform various optimizations and transformations. The final pass creates an LLVM IR representation of the program. **Commands:** - - `flang-new -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error - - `flang-new -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll + - `flang -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error + - `flang -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll ## Object code generation and linking diff --git a/flang/examples/FlangOmpReport/FlangOmpReport.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp index 9c1f304b9741e7..709c5c5d305e51 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReport.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp @@ -9,7 +9,7 @@ // all the OpenMP constructs and clauses and which line they're located on. // // The plugin may be invoked as: -// ./bin/flang-new -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report +// ./bin/flang -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report // -fopenmp // //===----------------------------------------------------------------------===// diff --git a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h index 9a70b7fbfad2b6..8ab5150cd7c812 100644 --- a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h +++ b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h @@ -67,7 +67,7 @@ struct AliasAnalysis { // end subroutine // ------------------------------------------------- // - // flang-new -fc1 -emit-fir test.f90 -o test.fir + // flang -fc1 -emit-fir test.f90 -o test.fir // // ------------------- test.fir -------------------- // fir.global @_QMtopEa : !fir.box>> diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h index 3e703de545950c..df4b21ada058fe 100644 --- a/flang/include/flang/Tools/CrossToolHelpers.h +++ b/flang/include/flang/Tools/CrossToolHelpers.h @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // A header file for containing functionallity that is used across Flang tools, // such as helper functions which apply or generate information needed accross -// tools like bbc and flang-new. +// tools like bbc and flang. //===----------------------------------------------------------------------===// #ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 05b03ba9ebdf30..18383eaafb1136 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -65,8 +65,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static bool parseShowColorsArgs(const llvm::opt::ArgList &args, bool defaultColor = true) { // Color diagnostics default to auto ("on" if terminal supports) in the - // compiler driver `flang-new` but default to off in the frontend driver - // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color. + // compiler driver `flang` but default to off in the frontend driver + // `flang -fc1`, needing an explicit OPT_fdiagnostics_color. // Support both clang's -f[no-]color-diagnostics and gcc's // -f[no-]diagnostics-colors[=never|always|auto]. enum { @@ -891,7 +891,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, } } - // Default to off for `flang-new -fc1`. + // Default to off for `flang -fc1`. res.getFrontendOpts().showColors = parseShowColorsArgs(args, /*defaultDiagColor=*/false); diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 4a52edc436e0ed..8f882bff170909 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -233,7 +233,7 @@ bool CodeGenAction::beginSourceFileAction() { llvm::SMDiagnostic err; llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx); if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) { - err.print("flang-new", llvm::errs()); + err.print("flang", llvm::errs()); unsigned diagID = ci.getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Error, "Could not parse IR"); ci.getDiagnostics().Report(diagID); diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e2cbd5112d6ea5..09ac129d3e6893 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->getFrontendOpts().showHelp) { clang::driver::getDriverOptTable().printHelp( - llvm::outs(), "flang-new -fc1 [options] file...", - "LLVM 'Flang' Compiler", + llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler", /*ShowHidden=*/false, /*ShowAllAliases=*/false, llvm::opt::Visibility(clang::driver::options::FC1Option)); return true; diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 0ad1b718d5875b..cdd2de541c6730 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -308,12 +308,12 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries" # If FortranRuntime is part of a Flang build (and not a separate build) then # add dependency to make sure that Fortran runtime library is being built after # we have the Flang compiler available. This also includes the MODULE files -# that compile when the 'flang-new' target is built. +# that compile when the 'flang' target is built. # # TODO: This is a workaround and should be updated when runtime build procedure # is changed to a regular runtime build. See discussion in PR #95388. -if (TARGET flang-new AND TARGET module_files) - add_dependencies(FortranRuntime flang-new module_files) +if (TARGET flang AND TARGET module_files) + add_dependencies(FortranRuntime flang module_files) endif() if (FLANG_CUF_RUNTIME) diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index a18a5c6519eda4..cab214c2ef4c8c 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -58,7 +58,7 @@ set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) set(FLANG_TEST_DEPENDS - flang-new + flang llvm-config FileCheck count diff --git a/flang/test/Driver/aarch64-outline-atomics.f90 b/flang/test/Driver/aarch64-outline-atomics.f90 index a1c874c20df5c7..530bfc8e962091 100644 --- a/flang/test/Driver/aarch64-outline-atomics.f90 +++ b/flang/test/Driver/aarch64-outline-atomics.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! Test that flang forwards the -moutline-atomics and -mno-outline-atomics. ! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s ! CHECK: "-target-feature" "+outline-atomics" diff --git a/flang/test/Driver/color-diagnostics-forwarding.f90 b/flang/test/Driver/color-diagnostics-forwarding.f90 index 368fa8834142ab..29061242cb0cbc 100644 --- a/flang/test/Driver/color-diagnostics-forwarding.f90 +++ b/flang/test/Driver/color-diagnostics-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards -f{no-}color-diagnostics and -! -f{no-}diagnostics-color options to flang-new -fc1 as expected. +! Test that flang forwards -f{no-}color-diagnostics and +! -f{no-}diagnostics-color options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \ ! RUN: | FileCheck %s --check-prefix=CHECK-CD diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90 index 7ec29ce7ba7abf..cefa86836abd30 100644 --- a/flang/test/Driver/compiler-options.f90 +++ b/flang/test/Driver/compiler-options.f90 @@ -1,6 +1,6 @@ ! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s -! Test communication of COMPILER_OPTIONS from flang-new to flang-new -fc1. -! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang-new{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" +! Test communication of COMPILER_OPTIONS from flang to flang -fc1. +! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" program main use ISO_FORTRAN_ENV, only: compiler_options implicit none diff --git a/flang/test/Driver/convert.f90 b/flang/test/Driver/convert.f90 index b2cf6c23efdb75..0ba31d2188cdf5 100755 --- a/flang/test/Driver/convert.f90 +++ b/flang/test/Driver/convert.f90 @@ -12,7 +12,7 @@ ! RUN: not %flang -fconvert=foobar %s 2>&1 | FileCheck %s --check-prefix=INVALID !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -emit-mlir -fconvert=unknown %s -o - | FileCheck %s --check-prefix=VALID_FC1 ! RUN: %flang_fc1 -emit-mlir -fconvert=native %s -o - | FileCheck %s --check-prefix=VALID_FC1 diff --git a/flang/test/Driver/disable-ext-name-interop.f90 b/flang/test/Driver/disable-ext-name-interop.f90 index 0c59a5b4c980f8..1ade84b996d043 100644 --- a/flang/test/Driver/disable-ext-name-interop.f90 +++ b/flang/test/Driver/disable-ext-name-interop.f90 @@ -1,4 +1,4 @@ -! Test that we can disable the ExternalNameConversion pass in flang-new. +! Test that we can disable the ExternalNameConversion pass in flang. ! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=EXTNAMES ! RUN: %flang_fc1 -S -mmlir -disable-external-name-interop %s -o - 2>&1 | FileCheck %s --check-prefix=INTNAMES diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index d1e1e1d90fe1f8..4c6aecb1c4fa7e 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -4,12 +4,12 @@ ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 -! VERSION: flang-new version +! VERSION: flang version ! VERSION-NEXT: Target: ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang-new: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/escaped-backslash.f90 b/flang/test/Driver/escaped-backslash.f90 index ad07eae24e9fab..90dd1783dd1150 100644 --- a/flang/test/Driver/escaped-backslash.f90 +++ b/flang/test/Driver/escaped-backslash.f90 @@ -1,14 +1,14 @@ ! Ensure argument -fbackslash works as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED diff --git a/flang/test/Driver/fdefault.f90 b/flang/test/Driver/fdefault.f90 index 88592bfa3e87ee..7ce45b763a240f 100644 --- a/flang/test/Driver/fdefault.f90 +++ b/flang/test/Driver/fdefault.f90 @@ -2,25 +2,25 @@ ! TODO: Add checks when actual codegen is possible for this family !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! NOOPTION: integer(4),parameter::real_kind=4_4 diff --git a/flang/test/Driver/flarge-sizes.f90 b/flang/test/Driver/flarge-sizes.f90 index 6ea5876676ed1f..6c41a03a830bfb 100644 --- a/flang/test/Driver/flarge-sizes.f90 +++ b/flang/test/Driver/flarge-sizes.f90 @@ -2,20 +2,20 @@ ! TODO: Add checks when actual codegen is possible. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE ! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 diff --git a/flang/test/Driver/frame-pointer-forwarding.f90 b/flang/test/Driver/frame-pointer-forwarding.f90 index 751494cc6a6017..9fcbd6e12f98b7 100644 --- a/flang/test/Driver/frame-pointer-forwarding.f90 +++ b/flang/test/Driver/frame-pointer-forwarding.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend +! Test that flang forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend ! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE ! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf" diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 index 35adb47b56861e..0a56a1e3710d9d 100644 --- a/flang/test/Driver/frontend-forwarding.f90 +++ b/flang/test/Driver/frontend-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards Flang frontend -! options to flang-new -fc1 as expected. +! Test that flang forwards Flang frontend +! options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \ ! RUN: -finput-charset=utf-8 \ diff --git a/flang/test/Driver/hlfir-no-hlfir-error.f90 b/flang/test/Driver/hlfir-no-hlfir-error.f90 index 2410393b6cd9c1..59f8304db5c9ab 100644 --- a/flang/test/Driver/hlfir-no-hlfir-error.f90 +++ b/flang/test/Driver/hlfir-no-hlfir-error.f90 @@ -2,12 +2,12 @@ ! options cannot be both used. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -emit-llvm -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s diff --git a/flang/test/Driver/intrinsic-module-path.f90 b/flang/test/Driver/intrinsic-module-path.f90 index 5523ed37b724cd..15d19dd83d963f 100644 --- a/flang/test/Driver/intrinsic-module-path.f90 +++ b/flang/test/Driver/intrinsic-module-path.f90 @@ -4,7 +4,7 @@ ! default one, causing a CHECKSUM error. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/large-data-threshold.f90 b/flang/test/Driver/large-data-threshold.f90 index 320566c4b2e43a..6a7eef79559d0b 100644 --- a/flang/test/Driver/large-data-threshold.f90 +++ b/flang/test/Driver/large-data-threshold.f90 @@ -7,11 +7,11 @@ ! RUN: not %flang -### -c --target=aarch64 -mcmodel=small -mlarge-data-threshold=32768 %s 2>&1 | FileCheck %s --check-prefix=NOT-SUPPORTED -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-mlarge-data-threshold=32768" -! CHECK-59000: "{{.*}}flang-new" "-fc1" +! CHECK-59000: "{{.*}}flang" "-fc1" ! CHECK-59000-SAME: "-mlarge-data-threshold=59000" -! CHECK-1M: "{{.*}}flang-new" "-fc1" +! CHECK-1M: "{{.*}}flang" "-fc1" ! CHECK-1M-SAME: "-mlarge-data-threshold=1048576" ! NO-MCMODEL: 'mlarge-data-threshold=' only applies to medium and large code models ! INVALID: error: invalid value 'nonsense' in '-mlarge-data-threshold=' diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index a51febc7009691..bad3d972e6bd6b 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang-new: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/macro-def-undef.F90 b/flang/test/Driver/macro-def-undef.F90 index 1332c6d6c02708..b13a9040833dbf 100644 --- a/flang/test/Driver/macro-def-undef.F90 +++ b/flang/test/Driver/macro-def-undef.F90 @@ -1,14 +1,14 @@ ! Ensure arguments -D and -U work as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 236325e3578f1d..51d37a718c542f 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -1,26 +1,26 @@ ! Test the behaviour of the driver when input is missing or is invalid. Note -! that with the compiler driver (flang-new), the input _has_ to be specified. +! that with the compiler driver (flang), the input _has_ to be specified. ! Indeed, the driver decides what "job/command" to create based on the input ! file's extension. No input file means that it doesn't know what to do -! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply +! (compile? preprocess? link?). The frontend driver (flang -fc1) simply ! assumes that "no explicit input == read from stdin" !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE ! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE !----------------------------------------- -! FLANG FRONTEND DRIVER (flang-new -fc1) +! FLANG FRONTEND DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang-new: error: no input files +! FLANG-NO-FILE: flang: error: no input files -! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang-new: error: no input files +! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 6c86f23f2b21fa..64ec8679abf94f 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang-new: error: cannot specify -o when generating multiple output files +! ERROR: flang: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index b0b94ab1386a74..7c51656f0001af 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -1,6 +1,6 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected. Assumes a gfx90a, aarch64, ! and sm_70 architecture, but doesn't require one to be ! installed or compiled for, just testing the appropriate ! generation of jobs are created with the correct @@ -8,8 +8,8 @@ ! Test regular -fopenmp with no offload ! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s -! CHECK-OPENMP: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" -! CHECK-OPENMP-NOT: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" +! CHECK-OPENMP-NOT: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Test regular -fopenmp with offload, and invocation filtering options ! RUN: %flang -S -### %s -o %t 2>&1 \ @@ -22,47 +22,47 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST -! OFFLOAD-HOST: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE -! OFFLOAD-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp ! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s -! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS -! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" ! OPENMP-OFFLOAD-ARGS-SAME: {{.*}}.f90" ! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fembed-offload-object={{.*}}.out" {{.*}}.bc" @@ -77,7 +77,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-threads-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS -! CHECK-THREADS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" +! CHECK-THREADS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -89,7 +89,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-teams-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS -! CHECK-TEAMS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" +! CHECK-TEAMS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -101,7 +101,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-nested-parallelism \ ! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR -! CHECK-NEST-PAR: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" +! CHECK-NEST-PAR: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -113,7 +113,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE -! CHECK-THREAD-STATE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" +! CHECK-THREAD-STATE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -125,7 +125,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" +! CHECK-TARGET-DEBUG: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -137,7 +137,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" +! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -153,7 +153,7 @@ ! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL -! CHECK-RTL-ALL: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" +! CHECK-RTL-ALL: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" ! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism" ! CHECK-RTL-ALL: {{.*}}.f90" @@ -167,7 +167,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-version=45 \ ! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION -! CHECK-OPENMP-VERSION: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" +! CHECK-OPENMP-VERSION: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" ! Test diagnostic error when host IR file is non-existent ! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \ @@ -187,7 +187,7 @@ ! RUN: --target=aarch64-unknown-linux-gnu \ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-NO-OFFLOAD -! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-NO-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! Test -fopenmp-force-usm option with offload @@ -196,16 +196,16 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-OFFLOAD -! FORCE-USM-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" -! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \ ! RUN: --offload-arch=gfx900 \ ! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ ! RUN: | FileCheck --check-prefix=MLINK-BUILTIN-BITCODE %s -! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! MLINK-BUILTIN-BITCODE-SAME: "-mlink-builtin-bitcode" {{.*Inputs.*rocm.*amdgcn.*bitcode.*}}oclc_isa_version_900.bc ! Test that the -fopenmp-targets option is added to host compilation invocations @@ -219,9 +219,9 @@ ! RUN: --target=x86_64-unknown-linux-gnu -nogpulib \ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-TARGETS -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" -! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-TARGETS-NOT: -fopenmp-targets -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" diff --git a/flang/test/Driver/predefined-macros-compiler-version.F90 b/flang/test/Driver/predefined-macros-compiler-version.F90 index 823a730f96845a..f6924479281562 100644 --- a/flang/test/Driver/predefined-macros-compiler-version.F90 +++ b/flang/test/Driver/predefined-macros-compiler-version.F90 @@ -1,12 +1,12 @@ ! Check that the driver correctly defines macros with the compiler version !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case diff --git a/flang/test/Driver/std2018-wrong.f90 b/flang/test/Driver/std2018-wrong.f90 index 27ccc76bd39aad..93ba153d75f7f9 100644 --- a/flang/test/Driver/std2018-wrong.f90 +++ b/flang/test/Driver/std2018-wrong.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG diff --git a/flang/test/Driver/std2018.f90 b/flang/test/Driver/std2018.f90 index cf461cf89e4e19..1727f92127b711 100644 --- a/flang/test/Driver/std2018.f90 +++ b/flang/test/Driver/std2018.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03 index 6e03f9f43fc602..1d850305cd040e 100644 --- a/flang/test/Driver/supported-suffices/f03-suffix.f03 +++ b/flang/test/Driver/supported-suffices/f03-suffix.f03 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f03 end program f03 diff --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08 index d5bcf4ce1de1cc..2b31e4c21876ae 100644 --- a/flang/test/Driver/supported-suffices/f08-suffix.f08 +++ b/flang/test/Driver/supported-suffices/f08-suffix.f08 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f08 end program f08 diff --git a/flang/test/Driver/use-module-error.f90 b/flang/test/Driver/use-module-error.f90 index 42d6650621c8c8..67335f61626817 100644 --- a/flang/test/Driver/use-module-error.f90 +++ b/flang/test/Driver/use-module-error.f90 @@ -1,14 +1,14 @@ ! Ensure that multiple module directories are not allowed !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE diff --git a/flang/test/Driver/use-module.f90 b/flang/test/Driver/use-module.f90 index 775c0424715883..2c3a38043fe16e 100644 --- a/flang/test/Driver/use-module.f90 +++ b/flang/test/Driver/use-module.f90 @@ -1,7 +1,7 @@ ! Checks that module search directories specified with `-J/-module-dir` and `-I` are handled correctly !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty @@ -16,7 +16,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty diff --git a/flang/test/Driver/version-loops.f90 b/flang/test/Driver/version-loops.f90 index b0fa01d572512a..d206393a04f486 100644 --- a/flang/test/Driver/version-loops.f90 +++ b/flang/test/Driver/version-loops.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards the -f{no-,}version-loops-for-stride -! options correctly to flang-new -fc1 for different variants of optimisation +! Test that flang forwards the -f{no-,}version-loops-for-stride +! options correctly to flang -fc1 for different variants of optimisation ! and explicit flags. ! RUN: %flang -### %s -o %t 2>&1 -O3 \ @@ -23,32 +23,32 @@ ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \ ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-fversion-loops-for-stride" ! CHECK-SAME: "-O3" -! CHECK-O2: "{{.*}}flang-new" "-fc1" +! CHECK-O2: "{{.*}}flang" "-fc1" ! CHECK-O2-NOT: "-fversion-loops-for-stride" ! CHECK-O2-SAME: "-O2" -! CHECK-O2-with: "{{.*}}flang-new" "-fc1" +! CHECK-O2-with: "{{.*}}flang" "-fc1" ! CHECK-O2-with-SAME: "-fversion-loops-for-stride" ! CHECK-O2-with-SAME: "-O2" -! CHECK-O4: "{{.*}}flang-new" "-fc1" +! CHECK-O4: "{{.*}}flang" "-fc1" ! CHECK-O4-SAME: "-fversion-loops-for-stride" ! CHECK-O4-SAME: "-O3" -! CHECK-Ofast: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast: "{{.*}}flang" "-fc1" ! CHECK-Ofast-SAME: "-ffast-math" ! CHECK-Ofast-SAME: "-fversion-loops-for-stride" ! CHECK-Ofast-SAME: "-O3" -! CHECK-Ofast-no: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast-no: "{{.*}}flang" "-fc1" ! CHECK-Ofast-no-SAME: "-ffast-math" ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride" ! CHECK-Ofast-no-SAME: "-O3" -! CHECK-O3-no: "{{.*}}flang-new" "-fc1" +! CHECK-O3-no: "{{.*}}flang" "-fc1" ! CHECK-O3-no-NOT: "-fversion-loops-for-stride" ! CHECK-O3-no-SAME: "-O3" diff --git a/flang/test/Driver/wextra-ok.f90 b/flang/test/Driver/wextra-ok.f90 index 6a38d9481a36b7..441029aa0af276 100644 --- a/flang/test/Driver/wextra-ok.f90 +++ b/flang/test/Driver/wextra-ok.f90 @@ -1,4 +1,4 @@ -! Ensure that supplying -Wextra into flang-new does not raise error +! Ensure that supplying -Wextra into flang does not raise error ! The first check should be changed if -Wextra is implemented ! RUN: %flang -std=f2018 -Wextra %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-OK diff --git a/flang/test/HLFIR/hlfir-flags.f90 b/flang/test/HLFIR/hlfir-flags.f90 index b383a79d12c27b..0b1e80b1e3f636 100644 --- a/flang/test/HLFIR/hlfir-flags.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,4 +1,4 @@ -! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang-new), and +! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang), and ! -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s diff --git a/flang/test/Lower/Intrinsics/command_argument_count.f90 b/flang/test/Lower/Intrinsics/command_argument_count.f90 index 0cf92d4444db98..a30b27d664fc0c 100644 --- a/flang/test/Lower/Intrinsics/command_argument_count.f90 +++ b/flang/test/Lower/Intrinsics/command_argument_count.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver -! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s +! bbc doesn't have a way to set the default kinds so we use flang driver +! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s ! CHECK-LABEL: argument_count_test subroutine argument_count_test() diff --git a/flang/test/Lower/Intrinsics/exit.f90 b/flang/test/Lower/Intrinsics/exit.f90 index c3110fcbec2b5a..bd551f7318a84a 100644 --- a/flang/test/Lower/Intrinsics/exit.f90 +++ b/flang/test/Lower/Intrinsics/exit.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver +! bbc doesn't have a way to set the default kinds so we use flang driver ! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s ! CHECK-LABEL: func @_QPexit_test1() { diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 index f9ab01881d250d..9b864c9a9849c3 100644 --- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 +++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: ieee_is_normal_f16 subroutine ieee_is_normal_f16(r) diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90 index 700b2d1a67c656..62b98c8ea98bee 100644 --- a/flang/test/Lower/Intrinsics/isnan.f90 +++ b/flang/test/Lower/Intrinsics/isnan.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: isnan_f32 subroutine isnan_f32(r) diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90 index ac18e59033a6b6..781ef8296a2b7d 100644 --- a/flang/test/Lower/Intrinsics/modulo.f90 +++ b/flang/test/Lower/Intrinsics/modulo.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL -! RUN: flang-new -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL +! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL ! ALL-LABEL: func @_QPmodulo_testr( ! ALL-SAME: %[[arg0:.*]]: !fir.ref{{.*}}, %[[arg1:.*]]: !fir.ref{{.*}}, %[[arg2:.*]]: !fir.ref{{.*}}) { diff --git a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 index f02884e5e92f38..425ccbc5dd56c5 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP allocate Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s program main integer :: x, y diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 index 3be61a1700ced3..7a7d28db8d6f5a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare reduction Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine declare_red() integer :: my_var diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 index c6a0a8f2cd0d22..be1ac2db5dfa4a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare simd Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine sub(x, y) real, intent(inout) :: x, y diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 index 62bc247a1456a1..bc5baf4e1cf604 100644 --- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 +++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 @@ -1,7 +1,7 @@ ! This test checks lowering of `LASTPRIVATE` clause for scalar types. ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s !CHECK: func @_QPlastprivate_character(%[[ARG1:.*]]: !fir.boxchar<1>{{.*}}) { !CHECK-DAG: %[[ARG1_UNBOX:.*]]:2 = fir.unboxchar diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 index 32caac39778dee..99c521406a7775 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(byref @add_reduction_byref_i32 diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 index fdedbb06160761..cfeb5de83f4e82 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(@add_reduction_i32 diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 4acbc0606d1977..f43234fb125b7e 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -132,13 +132,13 @@ tools = [ ToolSubst( "%flang", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=isysroot_flag, unresolved="fatal", ), ToolSubst( "%flang_fc1", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=["-fc1"], unresolved="fatal", ), diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 9d7b8633958cb7..4362fcf0537616 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set(module_objects "") # Create module files directly from the top-level module source directory. -# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was +# If CMAKE_CROSSCOMPILING, then the newly built flang executable was # cross compiled, and thus can't be executed on the build system and thus # can't be used for generating module files. if (NOT CMAKE_CROSSCOMPILING) @@ -115,9 +115,9 @@ if (NOT CMAKE_CROSSCOMPILING) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${FLANG_SOURCE_DIR}/module/${filename}.f90 - DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) list(APPEND MODULE_FILES ${base}.mod) install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") @@ -142,9 +142,9 @@ if (NOT CMAKE_CROSSCOMPILING) set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib) add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 - DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} + DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} ) add_custom_command(OUTPUT ${base}.f18.mod DEPENDS ${base}.mod diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 9f33cdfe3fa90f..615c673374faf4 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS TargetParser ) -add_flang_tool(flang-new +add_flang_tool(flang driver.cpp fc1_main.cpp ) -target_link_libraries(flang-new +target_link_libraries(flang PRIVATE flangFrontend flangFrontendTool ) -clang_target_link_libraries(flang-new +clang_target_link_libraries(flang PRIVATE clangDriver clangBasic @@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) -# Enable support for plugins, which need access to symbols from flang-new +# Enable support for plugins, which need access to symbols from flang if(FLANG_PLUGIN_SUPPORT) - export_executable_symbols_for_plugins(flang-new) + export_executable_symbols_for_plugins(flang) endif() -install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 52136df10c0b02..603aab4205836c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -95,7 +95,7 @@ int main(int argc, const char **argv) { llvm::StringSaver saver(a); ExpandResponseFiles(saver, args); - // Check if flang-new is in the frontend mode + // Check if flang is in the frontend mode auto firstArg = std::find_if(args.begin() + 1, args.end(), [](const char *a) { return a != nullptr; }); if (firstArg != args.end()) { @@ -104,7 +104,7 @@ int main(int argc, const char **argv) { << "Valid tools include '-fc1'.\n"; return 1; } - // Call flang-new frontend + // Call flang frontend if (llvm::StringRef(args[1]).starts_with("-fc1")) { return executeFC1Tool(args); } @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { // Set the environment variable, FLANG_COMPILER_OPTIONS_STRING, to contain all // the compiler options. This is intended for the frontend driver, - // flang-new -fc1, to enable the implementation of the COMPILER_OPTIONS + // flang -fc1, to enable the implementation of the COMPILER_OPTIONS // intrinsic. To this end, the frontend driver requires the list of the // original compiler options, which is not available through other means. // TODO: This way of passing information between the compiler and frontend diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index d948b7eb39b39c..9da1f926817a8b 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -504,15 +504,15 @@ if(build_runtimes) if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES) if (${LLVM_TOOL_FLANG_BUILD}) - message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new") - set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new") + message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang") + set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang") set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang") # TODO: This is a workaround until flang becomes a first-class project - # in llvm/CMakeList.txt. Until then, this line ensures that flang-new is - # built before "openmp" is built as a runtime project. Besides "flang-new" + # in llvm/CMakeList.txt. Until then, this line ensures that flang is + # built before "openmp" is built as a runtime project. Besides "flang" # to build the compiler, we also need to add "module_files" to make sure # that all .mod files are also properly build. - list(APPEND extra_deps "flang-new" "module_files") + list(APPEND extra_deps "flang" "module_files") endif() foreach(dep opt llvm-link llvm-extract clang clang-offload-packager) if(TARGET ${dep}) diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 9ffe8f56b76e67..9b771d1116ee38 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -89,9 +89,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 3b4259dfa380e8..c206386fa6b614 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -69,9 +69,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found >From b71c1d519cc61a751268b1ccda3fc59a966bab96 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 26 Sep 2024 10:39:53 -0500 Subject: [PATCH 2/6] [flang][driver] restore flang-new as symlink Restore flang-new as a symlink to flang for backwards compatibility Co-authored-by: H. Vetinari Co-authored-by: Andrzej Warzynski --- clang/lib/Driver/ToolChain.cpp | 3 +++ flang/tools/flang-driver/CMakeLists.txt | 4 ++++ flang/tools/flang-driver/driver.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 16f9b629fc538c..c9f3dbd7707b77 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -381,6 +381,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { {"cl", "--driver-mode=cl"}, {"++", "--driver-mode=g++"}, {"flang", "--driver-mode=flang"}, + // For backwards compatibility, we create a symlink for `flang` called + // `flang-new`. This will be removed in the future. + {"flang-new", "--driver-mode=flang"}, {"clang-dxc", "--driver-mode=dxc"}, }; diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 615c673374faf4..063acdd7dfe57c 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -36,3 +36,7 @@ if(FLANG_PLUGIN_SUPPORT) endif() install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") + +# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang" +# is a widely adopted name. +add_flang_symlink(flang-new flang) diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 603aab4205836c..ed52988feaa59c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -88,7 +88,8 @@ int main(int argc, const char **argv) { llvm::InitLLVM x(argc, argv); llvm::SmallVector args(argv, argv + argc); - clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang"); + clang::driver::ParsedClangName targetandMode = + clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]); std::string driverPath = getExecutablePath(args[0]); llvm::BumpPtrAllocator a; >From 443c951f8e0458e8b011424fad6a2e4b40b63144 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 30 Sep 2024 10:16:59 -0500 Subject: [PATCH 3/6] [flang][driver] add version to flang executable --- flang/tools/flang-driver/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 063acdd7dfe57c..9a89a6185a3291 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -28,6 +28,12 @@ clang_target_link_libraries(flang clangBasic ) +# This creates the executable with a version appended +# and creates a symlink to it without the version +if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows + set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION}) +endif() + option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) # Enable support for plugins, which need access to symbols from flang >From 27ae40d86f235890d109ca88682dd0caba0d2c93 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 3 Oct 2024 14:12:35 -0700 Subject: [PATCH 4/6] [flang][driver] add warning when using openmp --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 3 +++ clang/include/clang/Basic/DiagnosticGroups.td | 4 ++++ clang/lib/Driver/ToolChains/Flang.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 97573fcf20c1fb..68722ad9633120 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning< def warn_drv_unsupported_openmp_library : Warning< "the library '%0=%1' is not supported, OpenMP will not be enabled">, InGroup; +def warn_openmp_experimental : Warning< + "OpenMP support in flang is still experimental">, + InGroup; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 7d81bdf827ea0c..bfa065f018f8d8 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1582,3 +1582,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">; // Warnings about using the non-standard extension having an explicit specialization // with a storage class specifier. def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">; + +// A warning for options that enable a feature that is not yet complete +def ExperimentalOption : DiagGroup<"experimental-option">; + diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 1ca12ff81389a3..19b43594b00815 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); // FIXME: Clang supports a whole bunch more flags here. break; >From d8f95da5712a7d03a935c8b38f06d373c21f7a1f Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 06:27:05 -0700 Subject: [PATCH 5/6] [flang][doc] update note about CMake support --- flang/docs/FlangDriver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 47cf078cf2d0d4..23cbab30ee903e 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -335,7 +335,7 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a +(CMake 3.28.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use `flang` as follows: ```bash >From a35343fd31314a59f671474474258c8707c123ab Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 07:11:16 -0700 Subject: [PATCH 6/6] [flang][test] fix tests broken by rename --- flang/test/Driver/driver-version.f90 | 2 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/missing-input.f90 | 6 +++--- flang/test/Driver/multiple-input-files.f90 | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index 4c6aecb1c4fa7e..6daeb0e767c0e0 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -9,7 +9,7 @@ ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang{{.*}}: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index bad3d972e6bd6b..be9416810716a9 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang{{.*}}: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 51d37a718c542f..aeefbe14c20563 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -17,10 +17,10 @@ ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang: error: no input files +! FLANG-NO-FILE: flang{{.*}}: error: no input files -! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang: error: no input files +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 64ec8679abf94f..0242db288babf2 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang: error: cannot specify -o when generating multiple output files +! ERROR: flang{{.*}}: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. From openmp-commits at lists.llvm.org Fri Oct 4 07:56:26 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Fri, 04 Oct 2024 07:56:26 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6700021a.170a0220.12a9d5.c54f@mx.google.com> https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From 649a73478c78389560042030a9717a05e8e338a8 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/7] [flang][driver] rename flang-new to flang --- .github/workflows/release-binaries.yml | 2 +- clang/include/clang/Driver/Options.td | 4 +- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Driver/ToolChains/Flang.cpp | 6 +- clang/test/Driver/flang/flang.f90 | 2 +- clang/test/Driver/flang/flang_ucase.F90 | 2 +- .../Driver/flang/multiple-inputs-mixed.f90 | 2 +- clang/test/Driver/flang/multiple-inputs.f90 | 4 +- flang/docs/FlangDriver.md | 76 +++++++++---------- flang/docs/ImplementingASemanticCheck.md | 4 +- flang/docs/Overview.md | 26 +++---- .../FlangOmpReport/FlangOmpReport.cpp | 2 +- .../flang/Optimizer/Analysis/AliasAnalysis.h | 2 +- flang/include/flang/Tools/CrossToolHelpers.h | 2 +- flang/lib/Frontend/CompilerInvocation.cpp | 6 +- flang/lib/Frontend/FrontendActions.cpp | 2 +- .../ExecuteCompilerInvocation.cpp | 3 +- flang/runtime/CMakeLists.txt | 6 +- flang/test/CMakeLists.txt | 2 +- flang/test/Driver/aarch64-outline-atomics.f90 | 2 +- .../Driver/color-diagnostics-forwarding.f90 | 4 +- flang/test/Driver/compiler-options.f90 | 4 +- flang/test/Driver/convert.f90 | 2 +- .../test/Driver/disable-ext-name-interop.f90 | 2 +- flang/test/Driver/driver-version.f90 | 4 +- flang/test/Driver/escaped-backslash.f90 | 4 +- flang/test/Driver/fdefault.f90 | 28 +++---- flang/test/Driver/flarge-sizes.f90 | 20 ++--- .../test/Driver/frame-pointer-forwarding.f90 | 2 +- flang/test/Driver/frontend-forwarding.f90 | 4 +- flang/test/Driver/hlfir-no-hlfir-error.f90 | 4 +- flang/test/Driver/intrinsic-module-path.f90 | 2 +- flang/test/Driver/large-data-threshold.f90 | 6 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/macro-def-undef.F90 | 4 +- flang/test/Driver/missing-input.f90 | 14 ++-- flang/test/Driver/multiple-input-files.f90 | 2 +- flang/test/Driver/omp-driver-offload.f90 | 66 ++++++++-------- .../predefined-macros-compiler-version.F90 | 4 +- flang/test/Driver/std2018-wrong.f90 | 2 +- flang/test/Driver/std2018.f90 | 2 +- .../Driver/supported-suffices/f03-suffix.f03 | 2 +- .../Driver/supported-suffices/f08-suffix.f08 | 2 +- flang/test/Driver/use-module-error.f90 | 4 +- flang/test/Driver/use-module.f90 | 4 +- flang/test/Driver/version-loops.f90 | 18 ++--- flang/test/Driver/wextra-ok.f90 | 2 +- flang/test/HLFIR/hlfir-flags.f90 | 2 +- .../Intrinsics/command_argument_count.f90 | 4 +- flang/test/Lower/Intrinsics/exit.f90 | 2 +- .../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +- flang/test/Lower/Intrinsics/isnan.f90 | 2 +- flang/test/Lower/Intrinsics/modulo.f90 | 2 +- .../OpenMP/Todo/omp-declarative-allocate.f90 | 2 +- .../OpenMP/Todo/omp-declare-reduction.f90 | 2 +- .../Lower/OpenMP/Todo/omp-declare-simd.f90 | 2 +- .../parallel-lastprivate-clause-scalar.f90 | 2 +- .../parallel-wsloop-reduction-byref.f90 | 2 +- .../OpenMP/parallel-wsloop-reduction.f90 | 2 +- flang/test/lit.cfg.py | 4 +- flang/tools/f18/CMakeLists.txt | 10 +-- flang/tools/flang-driver/CMakeLists.txt | 12 +-- flang/tools/flang-driver/driver.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 10 +-- offload/CMakeLists.txt | 4 +- openmp/CMakeLists.txt | 4 +- 66 files changed, 220 insertions(+), 227 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 925912df6843e4..6073ebac9e6c2c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -328,7 +328,7 @@ jobs: run: | # Build some of the mlir tools that take a long time to link if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc fi ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \ mlir-bytecode-parser-fuzzer \ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 932cf13edab53d..4a45a825da8fa1 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6071,7 +6071,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; //===----------------------------------------------------------------------===// -// pie/pic options (clang + flang-new) +// pie/pic options (clang + flang) //===----------------------------------------------------------------------===// let Visibility = [ClangOption, FlangOption] in { @@ -6087,7 +6087,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group; } // let Vis = [Default, FlangOption] //===----------------------------------------------------------------------===// -// Target Options (clang + flang-new) +// Target Options (clang + flang) //===----------------------------------------------------------------------===// let Flags = [TargetSpecific] in { let Visibility = [ClangOption, FlangOption] in { diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index d0c8bdba0ede95..4243ee006c1553 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2021,7 +2021,7 @@ void Driver::PrintHelp(bool ShowHidden) const { void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { if (IsFlangMode()) { - OS << getClangToolFullVersion("flang-new") << '\n'; + OS << getClangToolFullVersion("flang") << '\n'; } else { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 98350690f8d20e..1ca12ff81389a3 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -881,14 +881,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); - // TODO: Replace flang-new with flang once the new driver replaces the - // throwaway driver - const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC)); + const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs, Output)); } -Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {} +Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {} diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 index ad4a3a3b6bd44d..b52977ee66d7b0 100644 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 index e89c053b327bc9..88aedc39fb94a7 100644 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/clang/test/Driver/flang/multiple-inputs-mixed.f90 index 2395dbecf1fe92..98d8cab00bdfdb 100644 --- a/clang/test/Driver/flang/multiple-inputs-mixed.f90 +++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90 @@ -1,7 +1,7 @@ ! Check that flang can handle mixed C and fortran inputs. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c" diff --git a/clang/test/Driver/flang/multiple-inputs.f90 b/clang/test/Driver/flang/multiple-inputs.f90 index ada999e927a6a0..3c0f22e5d3e508 100644 --- a/clang/test/Driver/flang/multiple-inputs.f90 +++ b/clang/test/Driver/flang/multiple-inputs.f90 @@ -1,7 +1,7 @@ ! Check that flang driver can handle multiple inputs at once. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90" diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 815c26a28dfdfa..47cf078cf2d0d4 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: -* the compiler driver, `flang-new` -* the frontend driver, `flang-new -fc1` - -> **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the -> diagrams reflect the final design that we are still working towards. +* the compiler driver, `flang` +* the frontend driver, `flang -fc1` The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering and linking). For frontend specific tasks, the compiler driver creates a -Fortran compilation job and delegates it to `flang-new -fc1`, the frontend +Fortran compilation job and delegates it to `flang -fc1`, the frontend driver. For linking, it creates a linker job and calls an external linker (e.g. LLVM's [`lld`](https://lld.llvm.org/)). It can also call other tools such as external assemblers (e.g. [`as`](https://www.gnu.org/software/binutils/)). In @@ -47,7 +43,7 @@ frontend. It uses MLIR and LLVM for code-generation and can be viewed as a driver for Flang, LLVM and MLIR libraries. Contrary to the compiler driver, it is not capable of calling any external tools (including linkers). It is aware of all the frontend internals that are "hidden" from the compiler driver. It -accepts many frontend-specific options not available in `flang-new` and as such +accepts many frontend-specific options not available in `flang` and as such it provides a finer control over the frontend. Note that this tool is mostly intended for Flang developers. In particular, there are no guarantees about the stability of its interface and compiler developers can use it to experiment @@ -62,30 +58,30 @@ frontend specific flag from the _compiler_ directly to the _frontend_ driver, e.g.: ```bash -flang-new -Xflang -fdebug-dump-parse-tree input.f95 +flang -Xflang -fdebug-dump-parse-tree input.f95 ``` -In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang-new +In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang -fc1`. Without the forwarding flag, `-Xflang`, you would see the following warning: ```bash -flang-new: warning: argument unused during compilation: +flang: warning: argument unused during compilation: ``` -As `-fdebug-dump-parse-tree` is only supported by `flang-new -fc1`, `flang-new` +As `-fdebug-dump-parse-tree` is only supported by `flang -fc1`, `flang` will ignore it when used without `Xflang`. ## Why Do We Need Two Drivers? -As hinted above, `flang-new` and `flang-new -fc1` are two separate tools. The -fact that these tools are accessed through one binary, `flang-new`, is just an +As hinted above, `flang` and `flang -fc1` are two separate tools. The +fact that these tools are accessed through one binary, `flang`, is just an implementation detail. Each tool has a separate list of options, albeit defined in the same file: `clang/include/clang/Driver/Options.td`. The separation helps us split various tasks and allows us to implement more -specialised tools. In particular, `flang-new` is not aware of various +specialised tools. In particular, `flang` is not aware of various compilation phases within the frontend (e.g. scanning, parsing or semantic -checks). It does not have to be. Conversely, the frontend driver, `flang-new +checks). It does not have to be. Conversely, the frontend driver, `flang -fc1`, needs not to be concerned with linkers or other external tools like assemblers. Nor does it need to know where to look for various systems libraries, which is usually OS and platform specific. @@ -104,7 +100,7 @@ GCC](https://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/GNU_C_Compiler_Archi In fact, Flang needs to adhere to this model in order to be able to re-use Clang's driver library. If you are more familiar with the [architecture of GFortran](https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gfortran/About-GNU-Fortran.html) -than Clang, then `flang-new` corresponds to `gfortran` and `flang-new -fc1` to +than Clang, then `flang` corresponds to `gfortran` and `flang -fc1` to `f951`. ## Compiler Driver @@ -135,7 +131,7 @@ output from one action is the input for the subsequent one. You can use the `-ccc-print-phases` flag to see the sequence of actions that the driver will create for your compiler invocation: ```bash -flang-new -ccc-print-phases -E file.f +flang -ccc-print-phases -E file.f +- 0: input, "file.f", f95-cpp-input 1: preprocessor, {0}, f95 ``` @@ -143,7 +139,7 @@ As you can see, for `-E` the driver creates only two jobs and stops immediately after preprocessing. The first job simply prepares the input. For `-c`, the pipeline of the created jobs is more complex: ```bash -flang-new -ccc-print-phases -c file.f +flang -ccc-print-phases -c file.f +- 0: input, "file.f", f95-cpp-input +- 1: preprocessor, {0}, f95 +- 2: compiler, {1}, ir @@ -158,7 +154,7 @@ command to call the frontend driver is generated (more specifically, an instance of `clang::driver::Command`). Every command is bound to an instance of `clang::driver::Tool`. For Flang we introduced a specialisation of this class: `clang::driver::Flang`. This class implements the logic to either translate or -forward compiler options to the frontend driver, `flang-new -fc1`. +forward compiler options to the frontend driver, `flang -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). @@ -232,12 +228,12 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/driver.cpp`. It can be accessed by -invoking the compiler driver, `flang-new`, with the `-fc1` flag. +invoking the compiler driver, `flang`, with the `-fc1` flag. The frontend driver will only run one action at a time. If you specify multiple action flags, only the last one will be taken into account. The default action is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other -words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only +words, `flang -fc1 ` is equivalent to `flang -fc1 -fsyntax-only `. ## Adding new Compiler Options @@ -262,8 +258,8 @@ similar semantics to your new option and start by copying that. For every new option, you will also have to define the visibility of the new option. This is controlled through the `Visibility` field. You can use the following Flang specific visibility flags to control this: - * `FlangOption` - this option will be available in the `flang-new` compiler driver, - * `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver, + * `FlangOption` - this option will be available in the `flang` compiler driver, + * `FC1Option` - this option will be available in the `flang -fc1` frontend driver, Options that are supported by clang should explicitly specify `ClangOption` in `Visibility`, and options that are only supported in Flang should not specify @@ -290,10 +286,10 @@ The parsing will depend on the semantics encoded in the TableGen definition. When adding a compiler driver option (i.e. an option that contains `FlangOption` among in it's `Visibility`) that you also intend to be understood -by the frontend, make sure that it is either forwarded to `flang-new -fc1` or +by the frontend, make sure that it is either forwarded to `flang -fc1` or translated into some other option that is accepted by the frontend driver. In the case of options that contain both `FlangOption` and `FC1Option` among its -flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is +flags, we usually just forward from `flang` to `flang -fc1`. This is then tested in `flang/test/Driver/frontend-forward.F90`. What follows is usually very dependant on the meaning of the corresponding @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use -`flang-new` as follows: +`flang` as follows: ```bash -cmake -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` @@ -353,14 +349,14 @@ where `` corresponds to the LLVM Flang version. ## Testing In LIT, we define two variables that you can use to invoke Flang's drivers: -* `%flang` is expanded as `flang-new` (i.e. the compiler driver) -* `%flang_fc1` is expanded as `flang-new -fc1` (i.e. the frontend driver) +* `%flang` is expanded as `flang` (i.e. the compiler driver) +* `%flang_fc1` is expanded as `flang -fc1` (i.e. the frontend driver) For most regression tests for the frontend, you will want to use `%flang_fc1`. In some cases, the observable behaviour will be identical regardless of whether `%flang` or `%flang_fc1` is used. However, when you are using `%flang` instead of `%flang_fc1`, the compiler driver will add extra flags to the frontend -driver invocation (i.e. `flang-new -fc1 -`). In some cases that might +driver invocation (i.e. `flang -fc1 -`). In some cases that might be exactly what you want to test. In fact, you can check these additional flags by using the `-###` compiler driver command line option. @@ -380,7 +376,7 @@ plugins. The process for using plugins includes: * [Creating a plugin](#creating-a-plugin) * [Loading and running a plugin](#loading-and-running-a-plugin) -Flang plugins are limited to `flang-new -fc1` and are currently only available / +Flang plugins are limited to `flang -fc1` and are currently only available / been tested on Linux. ### Creating a Plugin @@ -465,14 +461,14 @@ static FrontendPluginRegistry::Add X( ### Loading and Running a Plugin In order to use plugins, there are 2 command line options made available to the -frontend driver, `flang-new -fc1`: +frontend driver, `flang -fc1`: * [`-load `](#the--load-dsopath-option) for loading the dynamic shared object of the plugin * [`-plugin `](#the--plugin-name-option) for calling the registered plugin Invocation of the example plugin is done through: ```bash -flang-new -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 +flang -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 ``` Both these options are parsed in `flang/lib/Frontend/CompilerInvocation.cpp` and @@ -493,7 +489,7 @@ reports an error diagnostic and returns `nullptr`. ### Enabling In-Tree Plugins For in-tree plugins, there is the CMake flag `FLANG_PLUGIN_SUPPORT`, enabled by -default, that controls the exporting of executable symbols from `flang-new`, +default, that controls the exporting of executable symbols from `flang`, which plugins need access to. Additionally, there is the CMake flag `LLVM_BUILD_EXAMPLES`, turned off by default, that is used to control if the example programs are built. This includes plugins that are in the @@ -526,7 +522,7 @@ invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and `invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal passes at different points of the default pass pipeline. An example use of these extension point callbacks is shown in `registerDefaultInlinerPass` to invoke the -default inliner pass in `flang-new`. +default inliner pass in `flang`. ## LLVM Pass Plugins @@ -539,7 +535,7 @@ documentation for [`llvm::PassBuilder`](https://llvm.org/doxygen/classllvm_1_1PassBuilder.html) for details. -The framework to enable pass plugins in `flang-new` uses the exact same +The framework to enable pass plugins in `flang` uses the exact same machinery as that used by `clang` and thus has the same capabilities and limitations. @@ -547,7 +543,7 @@ In order to use a pass plugin, the pass(es) must be compiled into a dynamic shared object which is then loaded using the `-fpass-plugin` option. ``` -flang-new -fpass-plugin=/path/to/plugin.so +flang -fpass-plugin=/path/to/plugin.so ``` This option is available in both the compiler driver and the frontend driver. @@ -559,7 +555,7 @@ Pass extensions are similar to plugins, except that they can also be linked statically. Setting `-DLLVM_${NAME}_LINK_INTO_TOOLS` to `ON` in the cmake command turns the project into a statically linked extension. An example would be Polly, e.g., using `-DLLVM_POLLY_LINK_INTO_TOOLS=ON` would link Polly passes -into `flang-new` as built-in middle-end passes. +into `flang` as built-in middle-end passes. See the [`WritingAnLLVMNewPMPass`](https://llvm.org/docs/WritingAnLLVMNewPMPass.html#id9) diff --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md index 5b583d4f8031b8..598ef696ad14bf 100644 --- a/flang/docs/ImplementingASemanticCheck.md +++ b/flang/docs/ImplementingASemanticCheck.md @@ -68,7 +68,7 @@ of the call to `intentOutFunc()`: I also used this program to produce a parse tree for the program using the command: ```bash - flang-new -fc1 -fdebug-dump-parse-tree testfun.f90 + flang -fc1 -fdebug-dump-parse-tree testfun.f90 ``` Here's the relevant fragment of the parse tree produced by the compiler: @@ -296,7 +296,7 @@ In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation: I then built the compiler with these changes and ran it on my test program. This time, I made sure to invoke semantic checking. Here's the command I used: ```bash - flang-new -fc1 -fdebug-unparse-with-symbols testfun.f90 + flang -fc1 -fdebug-unparse-with-symbols testfun.f90 ``` This produced the output: diff --git a/flang/docs/Overview.md b/flang/docs/Overview.md index 6eba19ea3a3c0d..dfb4d89264a755 100644 --- a/flang/docs/Overview.md +++ b/flang/docs/Overview.md @@ -65,8 +65,8 @@ See [Preprocessing.md](Preprocessing.md). **Entry point:** `parser::Parsing::Prescan` **Commands:** - - `flang-new -fc1 -E src.f90` dumps the cooked character stream - - `flang-new -fc1 -fdebug-dump-provenance src.f90` dumps provenance + - `flang -fc1 -E src.f90` dumps the cooked character stream + - `flang -fc1 -fdebug-dump-provenance src.f90` dumps provenance information ### Parsing @@ -80,10 +80,10 @@ representing a syntactically correct program, rooted at the program unit. See: **Entry point:** `parser::Parsing::Parse` **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree - - `flang-new -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran - - `flang-new -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log - - `flang-new -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree + - `flang -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree + - `flang -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran + - `flang -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log + - `flang -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree ### Semantic processing @@ -121,9 +121,9 @@ In the course of semantic analysis, the compiler: At the end of semantic processing, all validation of the user's program is complete. This is the last detailed phase of analysis processing. **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis - - `flang-new -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table - - `flang-new -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table + - `flang -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis + - `flang -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table + - `flang -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table ## Lowering @@ -163,8 +163,8 @@ contain a list of evaluations. All of these contain pointers back into the parse tree. The compiler walks the PFT generating FIR. **Commands:** - - `flang-new -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree - - `flang-new -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir + - `flang -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree + - `flang -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir ### Transformation passes @@ -180,8 +180,8 @@ perform various optimizations and transformations. The final pass creates an LLVM IR representation of the program. **Commands:** - - `flang-new -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error - - `flang-new -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll + - `flang -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error + - `flang -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll ## Object code generation and linking diff --git a/flang/examples/FlangOmpReport/FlangOmpReport.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp index 9c1f304b9741e7..709c5c5d305e51 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReport.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp @@ -9,7 +9,7 @@ // all the OpenMP constructs and clauses and which line they're located on. // // The plugin may be invoked as: -// ./bin/flang-new -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report +// ./bin/flang -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report // -fopenmp // //===----------------------------------------------------------------------===// diff --git a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h index 9a70b7fbfad2b6..8ab5150cd7c812 100644 --- a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h +++ b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h @@ -67,7 +67,7 @@ struct AliasAnalysis { // end subroutine // ------------------------------------------------- // - // flang-new -fc1 -emit-fir test.f90 -o test.fir + // flang -fc1 -emit-fir test.f90 -o test.fir // // ------------------- test.fir -------------------- // fir.global @_QMtopEa : !fir.box>> diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h index 3e703de545950c..df4b21ada058fe 100644 --- a/flang/include/flang/Tools/CrossToolHelpers.h +++ b/flang/include/flang/Tools/CrossToolHelpers.h @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // A header file for containing functionallity that is used across Flang tools, // such as helper functions which apply or generate information needed accross -// tools like bbc and flang-new. +// tools like bbc and flang. //===----------------------------------------------------------------------===// #ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 05b03ba9ebdf30..18383eaafb1136 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -65,8 +65,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static bool parseShowColorsArgs(const llvm::opt::ArgList &args, bool defaultColor = true) { // Color diagnostics default to auto ("on" if terminal supports) in the - // compiler driver `flang-new` but default to off in the frontend driver - // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color. + // compiler driver `flang` but default to off in the frontend driver + // `flang -fc1`, needing an explicit OPT_fdiagnostics_color. // Support both clang's -f[no-]color-diagnostics and gcc's // -f[no-]diagnostics-colors[=never|always|auto]. enum { @@ -891,7 +891,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, } } - // Default to off for `flang-new -fc1`. + // Default to off for `flang -fc1`. res.getFrontendOpts().showColors = parseShowColorsArgs(args, /*defaultDiagColor=*/false); diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 4a52edc436e0ed..8f882bff170909 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -233,7 +233,7 @@ bool CodeGenAction::beginSourceFileAction() { llvm::SMDiagnostic err; llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx); if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) { - err.print("flang-new", llvm::errs()); + err.print("flang", llvm::errs()); unsigned diagID = ci.getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Error, "Could not parse IR"); ci.getDiagnostics().Report(diagID); diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e2cbd5112d6ea5..09ac129d3e6893 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->getFrontendOpts().showHelp) { clang::driver::getDriverOptTable().printHelp( - llvm::outs(), "flang-new -fc1 [options] file...", - "LLVM 'Flang' Compiler", + llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler", /*ShowHidden=*/false, /*ShowAllAliases=*/false, llvm::opt::Visibility(clang::driver::options::FC1Option)); return true; diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 0ad1b718d5875b..cdd2de541c6730 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -308,12 +308,12 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries" # If FortranRuntime is part of a Flang build (and not a separate build) then # add dependency to make sure that Fortran runtime library is being built after # we have the Flang compiler available. This also includes the MODULE files -# that compile when the 'flang-new' target is built. +# that compile when the 'flang' target is built. # # TODO: This is a workaround and should be updated when runtime build procedure # is changed to a regular runtime build. See discussion in PR #95388. -if (TARGET flang-new AND TARGET module_files) - add_dependencies(FortranRuntime flang-new module_files) +if (TARGET flang AND TARGET module_files) + add_dependencies(FortranRuntime flang module_files) endif() if (FLANG_CUF_RUNTIME) diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index a18a5c6519eda4..cab214c2ef4c8c 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -58,7 +58,7 @@ set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) set(FLANG_TEST_DEPENDS - flang-new + flang llvm-config FileCheck count diff --git a/flang/test/Driver/aarch64-outline-atomics.f90 b/flang/test/Driver/aarch64-outline-atomics.f90 index a1c874c20df5c7..530bfc8e962091 100644 --- a/flang/test/Driver/aarch64-outline-atomics.f90 +++ b/flang/test/Driver/aarch64-outline-atomics.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! Test that flang forwards the -moutline-atomics and -mno-outline-atomics. ! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s ! CHECK: "-target-feature" "+outline-atomics" diff --git a/flang/test/Driver/color-diagnostics-forwarding.f90 b/flang/test/Driver/color-diagnostics-forwarding.f90 index 368fa8834142ab..29061242cb0cbc 100644 --- a/flang/test/Driver/color-diagnostics-forwarding.f90 +++ b/flang/test/Driver/color-diagnostics-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards -f{no-}color-diagnostics and -! -f{no-}diagnostics-color options to flang-new -fc1 as expected. +! Test that flang forwards -f{no-}color-diagnostics and +! -f{no-}diagnostics-color options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \ ! RUN: | FileCheck %s --check-prefix=CHECK-CD diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90 index 7ec29ce7ba7abf..cefa86836abd30 100644 --- a/flang/test/Driver/compiler-options.f90 +++ b/flang/test/Driver/compiler-options.f90 @@ -1,6 +1,6 @@ ! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s -! Test communication of COMPILER_OPTIONS from flang-new to flang-new -fc1. -! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang-new{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" +! Test communication of COMPILER_OPTIONS from flang to flang -fc1. +! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" program main use ISO_FORTRAN_ENV, only: compiler_options implicit none diff --git a/flang/test/Driver/convert.f90 b/flang/test/Driver/convert.f90 index b2cf6c23efdb75..0ba31d2188cdf5 100755 --- a/flang/test/Driver/convert.f90 +++ b/flang/test/Driver/convert.f90 @@ -12,7 +12,7 @@ ! RUN: not %flang -fconvert=foobar %s 2>&1 | FileCheck %s --check-prefix=INVALID !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -emit-mlir -fconvert=unknown %s -o - | FileCheck %s --check-prefix=VALID_FC1 ! RUN: %flang_fc1 -emit-mlir -fconvert=native %s -o - | FileCheck %s --check-prefix=VALID_FC1 diff --git a/flang/test/Driver/disable-ext-name-interop.f90 b/flang/test/Driver/disable-ext-name-interop.f90 index 0c59a5b4c980f8..1ade84b996d043 100644 --- a/flang/test/Driver/disable-ext-name-interop.f90 +++ b/flang/test/Driver/disable-ext-name-interop.f90 @@ -1,4 +1,4 @@ -! Test that we can disable the ExternalNameConversion pass in flang-new. +! Test that we can disable the ExternalNameConversion pass in flang. ! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=EXTNAMES ! RUN: %flang_fc1 -S -mmlir -disable-external-name-interop %s -o - 2>&1 | FileCheck %s --check-prefix=INTNAMES diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index d1e1e1d90fe1f8..4c6aecb1c4fa7e 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -4,12 +4,12 @@ ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 -! VERSION: flang-new version +! VERSION: flang version ! VERSION-NEXT: Target: ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang-new: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/escaped-backslash.f90 b/flang/test/Driver/escaped-backslash.f90 index ad07eae24e9fab..90dd1783dd1150 100644 --- a/flang/test/Driver/escaped-backslash.f90 +++ b/flang/test/Driver/escaped-backslash.f90 @@ -1,14 +1,14 @@ ! Ensure argument -fbackslash works as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED diff --git a/flang/test/Driver/fdefault.f90 b/flang/test/Driver/fdefault.f90 index 88592bfa3e87ee..7ce45b763a240f 100644 --- a/flang/test/Driver/fdefault.f90 +++ b/flang/test/Driver/fdefault.f90 @@ -2,25 +2,25 @@ ! TODO: Add checks when actual codegen is possible for this family !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! NOOPTION: integer(4),parameter::real_kind=4_4 diff --git a/flang/test/Driver/flarge-sizes.f90 b/flang/test/Driver/flarge-sizes.f90 index 6ea5876676ed1f..6c41a03a830bfb 100644 --- a/flang/test/Driver/flarge-sizes.f90 +++ b/flang/test/Driver/flarge-sizes.f90 @@ -2,20 +2,20 @@ ! TODO: Add checks when actual codegen is possible. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE ! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 diff --git a/flang/test/Driver/frame-pointer-forwarding.f90 b/flang/test/Driver/frame-pointer-forwarding.f90 index 751494cc6a6017..9fcbd6e12f98b7 100644 --- a/flang/test/Driver/frame-pointer-forwarding.f90 +++ b/flang/test/Driver/frame-pointer-forwarding.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend +! Test that flang forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend ! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE ! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf" diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 index 35adb47b56861e..0a56a1e3710d9d 100644 --- a/flang/test/Driver/frontend-forwarding.f90 +++ b/flang/test/Driver/frontend-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards Flang frontend -! options to flang-new -fc1 as expected. +! Test that flang forwards Flang frontend +! options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \ ! RUN: -finput-charset=utf-8 \ diff --git a/flang/test/Driver/hlfir-no-hlfir-error.f90 b/flang/test/Driver/hlfir-no-hlfir-error.f90 index 2410393b6cd9c1..59f8304db5c9ab 100644 --- a/flang/test/Driver/hlfir-no-hlfir-error.f90 +++ b/flang/test/Driver/hlfir-no-hlfir-error.f90 @@ -2,12 +2,12 @@ ! options cannot be both used. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -emit-llvm -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s diff --git a/flang/test/Driver/intrinsic-module-path.f90 b/flang/test/Driver/intrinsic-module-path.f90 index 5523ed37b724cd..15d19dd83d963f 100644 --- a/flang/test/Driver/intrinsic-module-path.f90 +++ b/flang/test/Driver/intrinsic-module-path.f90 @@ -4,7 +4,7 @@ ! default one, causing a CHECKSUM error. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/large-data-threshold.f90 b/flang/test/Driver/large-data-threshold.f90 index 320566c4b2e43a..6a7eef79559d0b 100644 --- a/flang/test/Driver/large-data-threshold.f90 +++ b/flang/test/Driver/large-data-threshold.f90 @@ -7,11 +7,11 @@ ! RUN: not %flang -### -c --target=aarch64 -mcmodel=small -mlarge-data-threshold=32768 %s 2>&1 | FileCheck %s --check-prefix=NOT-SUPPORTED -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-mlarge-data-threshold=32768" -! CHECK-59000: "{{.*}}flang-new" "-fc1" +! CHECK-59000: "{{.*}}flang" "-fc1" ! CHECK-59000-SAME: "-mlarge-data-threshold=59000" -! CHECK-1M: "{{.*}}flang-new" "-fc1" +! CHECK-1M: "{{.*}}flang" "-fc1" ! CHECK-1M-SAME: "-mlarge-data-threshold=1048576" ! NO-MCMODEL: 'mlarge-data-threshold=' only applies to medium and large code models ! INVALID: error: invalid value 'nonsense' in '-mlarge-data-threshold=' diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index a51febc7009691..bad3d972e6bd6b 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang-new: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/macro-def-undef.F90 b/flang/test/Driver/macro-def-undef.F90 index 1332c6d6c02708..b13a9040833dbf 100644 --- a/flang/test/Driver/macro-def-undef.F90 +++ b/flang/test/Driver/macro-def-undef.F90 @@ -1,14 +1,14 @@ ! Ensure arguments -D and -U work as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 236325e3578f1d..51d37a718c542f 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -1,26 +1,26 @@ ! Test the behaviour of the driver when input is missing or is invalid. Note -! that with the compiler driver (flang-new), the input _has_ to be specified. +! that with the compiler driver (flang), the input _has_ to be specified. ! Indeed, the driver decides what "job/command" to create based on the input ! file's extension. No input file means that it doesn't know what to do -! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply +! (compile? preprocess? link?). The frontend driver (flang -fc1) simply ! assumes that "no explicit input == read from stdin" !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE ! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE !----------------------------------------- -! FLANG FRONTEND DRIVER (flang-new -fc1) +! FLANG FRONTEND DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang-new: error: no input files +! FLANG-NO-FILE: flang: error: no input files -! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang-new: error: no input files +! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 6c86f23f2b21fa..64ec8679abf94f 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang-new: error: cannot specify -o when generating multiple output files +! ERROR: flang: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index b0b94ab1386a74..7c51656f0001af 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -1,6 +1,6 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected. Assumes a gfx90a, aarch64, ! and sm_70 architecture, but doesn't require one to be ! installed or compiled for, just testing the appropriate ! generation of jobs are created with the correct @@ -8,8 +8,8 @@ ! Test regular -fopenmp with no offload ! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s -! CHECK-OPENMP: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" -! CHECK-OPENMP-NOT: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" +! CHECK-OPENMP-NOT: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Test regular -fopenmp with offload, and invocation filtering options ! RUN: %flang -S -### %s -o %t 2>&1 \ @@ -22,47 +22,47 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST -! OFFLOAD-HOST: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE -! OFFLOAD-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp ! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s -! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS -! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" ! OPENMP-OFFLOAD-ARGS-SAME: {{.*}}.f90" ! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fembed-offload-object={{.*}}.out" {{.*}}.bc" @@ -77,7 +77,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-threads-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS -! CHECK-THREADS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" +! CHECK-THREADS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -89,7 +89,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-teams-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS -! CHECK-TEAMS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" +! CHECK-TEAMS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -101,7 +101,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-nested-parallelism \ ! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR -! CHECK-NEST-PAR: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" +! CHECK-NEST-PAR: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -113,7 +113,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE -! CHECK-THREAD-STATE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" +! CHECK-THREAD-STATE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -125,7 +125,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" +! CHECK-TARGET-DEBUG: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -137,7 +137,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" +! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -153,7 +153,7 @@ ! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL -! CHECK-RTL-ALL: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" +! CHECK-RTL-ALL: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" ! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism" ! CHECK-RTL-ALL: {{.*}}.f90" @@ -167,7 +167,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-version=45 \ ! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION -! CHECK-OPENMP-VERSION: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" +! CHECK-OPENMP-VERSION: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" ! Test diagnostic error when host IR file is non-existent ! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \ @@ -187,7 +187,7 @@ ! RUN: --target=aarch64-unknown-linux-gnu \ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-NO-OFFLOAD -! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-NO-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! Test -fopenmp-force-usm option with offload @@ -196,16 +196,16 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-OFFLOAD -! FORCE-USM-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" -! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \ ! RUN: --offload-arch=gfx900 \ ! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ ! RUN: | FileCheck --check-prefix=MLINK-BUILTIN-BITCODE %s -! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! MLINK-BUILTIN-BITCODE-SAME: "-mlink-builtin-bitcode" {{.*Inputs.*rocm.*amdgcn.*bitcode.*}}oclc_isa_version_900.bc ! Test that the -fopenmp-targets option is added to host compilation invocations @@ -219,9 +219,9 @@ ! RUN: --target=x86_64-unknown-linux-gnu -nogpulib \ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-TARGETS -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" -! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-TARGETS-NOT: -fopenmp-targets -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" diff --git a/flang/test/Driver/predefined-macros-compiler-version.F90 b/flang/test/Driver/predefined-macros-compiler-version.F90 index 823a730f96845a..f6924479281562 100644 --- a/flang/test/Driver/predefined-macros-compiler-version.F90 +++ b/flang/test/Driver/predefined-macros-compiler-version.F90 @@ -1,12 +1,12 @@ ! Check that the driver correctly defines macros with the compiler version !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case diff --git a/flang/test/Driver/std2018-wrong.f90 b/flang/test/Driver/std2018-wrong.f90 index 27ccc76bd39aad..93ba153d75f7f9 100644 --- a/flang/test/Driver/std2018-wrong.f90 +++ b/flang/test/Driver/std2018-wrong.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG diff --git a/flang/test/Driver/std2018.f90 b/flang/test/Driver/std2018.f90 index cf461cf89e4e19..1727f92127b711 100644 --- a/flang/test/Driver/std2018.f90 +++ b/flang/test/Driver/std2018.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03 index 6e03f9f43fc602..1d850305cd040e 100644 --- a/flang/test/Driver/supported-suffices/f03-suffix.f03 +++ b/flang/test/Driver/supported-suffices/f03-suffix.f03 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f03 end program f03 diff --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08 index d5bcf4ce1de1cc..2b31e4c21876ae 100644 --- a/flang/test/Driver/supported-suffices/f08-suffix.f08 +++ b/flang/test/Driver/supported-suffices/f08-suffix.f08 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f08 end program f08 diff --git a/flang/test/Driver/use-module-error.f90 b/flang/test/Driver/use-module-error.f90 index 42d6650621c8c8..67335f61626817 100644 --- a/flang/test/Driver/use-module-error.f90 +++ b/flang/test/Driver/use-module-error.f90 @@ -1,14 +1,14 @@ ! Ensure that multiple module directories are not allowed !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE diff --git a/flang/test/Driver/use-module.f90 b/flang/test/Driver/use-module.f90 index 775c0424715883..2c3a38043fe16e 100644 --- a/flang/test/Driver/use-module.f90 +++ b/flang/test/Driver/use-module.f90 @@ -1,7 +1,7 @@ ! Checks that module search directories specified with `-J/-module-dir` and `-I` are handled correctly !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty @@ -16,7 +16,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty diff --git a/flang/test/Driver/version-loops.f90 b/flang/test/Driver/version-loops.f90 index b0fa01d572512a..d206393a04f486 100644 --- a/flang/test/Driver/version-loops.f90 +++ b/flang/test/Driver/version-loops.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards the -f{no-,}version-loops-for-stride -! options correctly to flang-new -fc1 for different variants of optimisation +! Test that flang forwards the -f{no-,}version-loops-for-stride +! options correctly to flang -fc1 for different variants of optimisation ! and explicit flags. ! RUN: %flang -### %s -o %t 2>&1 -O3 \ @@ -23,32 +23,32 @@ ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \ ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-fversion-loops-for-stride" ! CHECK-SAME: "-O3" -! CHECK-O2: "{{.*}}flang-new" "-fc1" +! CHECK-O2: "{{.*}}flang" "-fc1" ! CHECK-O2-NOT: "-fversion-loops-for-stride" ! CHECK-O2-SAME: "-O2" -! CHECK-O2-with: "{{.*}}flang-new" "-fc1" +! CHECK-O2-with: "{{.*}}flang" "-fc1" ! CHECK-O2-with-SAME: "-fversion-loops-for-stride" ! CHECK-O2-with-SAME: "-O2" -! CHECK-O4: "{{.*}}flang-new" "-fc1" +! CHECK-O4: "{{.*}}flang" "-fc1" ! CHECK-O4-SAME: "-fversion-loops-for-stride" ! CHECK-O4-SAME: "-O3" -! CHECK-Ofast: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast: "{{.*}}flang" "-fc1" ! CHECK-Ofast-SAME: "-ffast-math" ! CHECK-Ofast-SAME: "-fversion-loops-for-stride" ! CHECK-Ofast-SAME: "-O3" -! CHECK-Ofast-no: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast-no: "{{.*}}flang" "-fc1" ! CHECK-Ofast-no-SAME: "-ffast-math" ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride" ! CHECK-Ofast-no-SAME: "-O3" -! CHECK-O3-no: "{{.*}}flang-new" "-fc1" +! CHECK-O3-no: "{{.*}}flang" "-fc1" ! CHECK-O3-no-NOT: "-fversion-loops-for-stride" ! CHECK-O3-no-SAME: "-O3" diff --git a/flang/test/Driver/wextra-ok.f90 b/flang/test/Driver/wextra-ok.f90 index 6a38d9481a36b7..441029aa0af276 100644 --- a/flang/test/Driver/wextra-ok.f90 +++ b/flang/test/Driver/wextra-ok.f90 @@ -1,4 +1,4 @@ -! Ensure that supplying -Wextra into flang-new does not raise error +! Ensure that supplying -Wextra into flang does not raise error ! The first check should be changed if -Wextra is implemented ! RUN: %flang -std=f2018 -Wextra %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-OK diff --git a/flang/test/HLFIR/hlfir-flags.f90 b/flang/test/HLFIR/hlfir-flags.f90 index b383a79d12c27b..0b1e80b1e3f636 100644 --- a/flang/test/HLFIR/hlfir-flags.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,4 +1,4 @@ -! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang-new), and +! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang), and ! -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s diff --git a/flang/test/Lower/Intrinsics/command_argument_count.f90 b/flang/test/Lower/Intrinsics/command_argument_count.f90 index 0cf92d4444db98..a30b27d664fc0c 100644 --- a/flang/test/Lower/Intrinsics/command_argument_count.f90 +++ b/flang/test/Lower/Intrinsics/command_argument_count.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver -! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s +! bbc doesn't have a way to set the default kinds so we use flang driver +! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s ! CHECK-LABEL: argument_count_test subroutine argument_count_test() diff --git a/flang/test/Lower/Intrinsics/exit.f90 b/flang/test/Lower/Intrinsics/exit.f90 index c3110fcbec2b5a..bd551f7318a84a 100644 --- a/flang/test/Lower/Intrinsics/exit.f90 +++ b/flang/test/Lower/Intrinsics/exit.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver +! bbc doesn't have a way to set the default kinds so we use flang driver ! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s ! CHECK-LABEL: func @_QPexit_test1() { diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 index f9ab01881d250d..9b864c9a9849c3 100644 --- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 +++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: ieee_is_normal_f16 subroutine ieee_is_normal_f16(r) diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90 index 700b2d1a67c656..62b98c8ea98bee 100644 --- a/flang/test/Lower/Intrinsics/isnan.f90 +++ b/flang/test/Lower/Intrinsics/isnan.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: isnan_f32 subroutine isnan_f32(r) diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90 index ac18e59033a6b6..781ef8296a2b7d 100644 --- a/flang/test/Lower/Intrinsics/modulo.f90 +++ b/flang/test/Lower/Intrinsics/modulo.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL -! RUN: flang-new -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL +! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL ! ALL-LABEL: func @_QPmodulo_testr( ! ALL-SAME: %[[arg0:.*]]: !fir.ref{{.*}}, %[[arg1:.*]]: !fir.ref{{.*}}, %[[arg2:.*]]: !fir.ref{{.*}}) { diff --git a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 index f02884e5e92f38..425ccbc5dd56c5 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP allocate Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s program main integer :: x, y diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 index 3be61a1700ced3..7a7d28db8d6f5a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare reduction Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine declare_red() integer :: my_var diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 index c6a0a8f2cd0d22..be1ac2db5dfa4a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare simd Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine sub(x, y) real, intent(inout) :: x, y diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 index 62bc247a1456a1..bc5baf4e1cf604 100644 --- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 +++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 @@ -1,7 +1,7 @@ ! This test checks lowering of `LASTPRIVATE` clause for scalar types. ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s !CHECK: func @_QPlastprivate_character(%[[ARG1:.*]]: !fir.boxchar<1>{{.*}}) { !CHECK-DAG: %[[ARG1_UNBOX:.*]]:2 = fir.unboxchar diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 index 32caac39778dee..99c521406a7775 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(byref @add_reduction_byref_i32 diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 index fdedbb06160761..cfeb5de83f4e82 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(@add_reduction_i32 diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 4acbc0606d1977..f43234fb125b7e 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -132,13 +132,13 @@ tools = [ ToolSubst( "%flang", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=isysroot_flag, unresolved="fatal", ), ToolSubst( "%flang_fc1", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=["-fc1"], unresolved="fatal", ), diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 9d7b8633958cb7..4362fcf0537616 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set(module_objects "") # Create module files directly from the top-level module source directory. -# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was +# If CMAKE_CROSSCOMPILING, then the newly built flang executable was # cross compiled, and thus can't be executed on the build system and thus # can't be used for generating module files. if (NOT CMAKE_CROSSCOMPILING) @@ -115,9 +115,9 @@ if (NOT CMAKE_CROSSCOMPILING) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${FLANG_SOURCE_DIR}/module/${filename}.f90 - DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) list(APPEND MODULE_FILES ${base}.mod) install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") @@ -142,9 +142,9 @@ if (NOT CMAKE_CROSSCOMPILING) set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib) add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 - DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} + DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} ) add_custom_command(OUTPUT ${base}.f18.mod DEPENDS ${base}.mod diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 9f33cdfe3fa90f..615c673374faf4 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS TargetParser ) -add_flang_tool(flang-new +add_flang_tool(flang driver.cpp fc1_main.cpp ) -target_link_libraries(flang-new +target_link_libraries(flang PRIVATE flangFrontend flangFrontendTool ) -clang_target_link_libraries(flang-new +clang_target_link_libraries(flang PRIVATE clangDriver clangBasic @@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) -# Enable support for plugins, which need access to symbols from flang-new +# Enable support for plugins, which need access to symbols from flang if(FLANG_PLUGIN_SUPPORT) - export_executable_symbols_for_plugins(flang-new) + export_executable_symbols_for_plugins(flang) endif() -install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 52136df10c0b02..603aab4205836c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -95,7 +95,7 @@ int main(int argc, const char **argv) { llvm::StringSaver saver(a); ExpandResponseFiles(saver, args); - // Check if flang-new is in the frontend mode + // Check if flang is in the frontend mode auto firstArg = std::find_if(args.begin() + 1, args.end(), [](const char *a) { return a != nullptr; }); if (firstArg != args.end()) { @@ -104,7 +104,7 @@ int main(int argc, const char **argv) { << "Valid tools include '-fc1'.\n"; return 1; } - // Call flang-new frontend + // Call flang frontend if (llvm::StringRef(args[1]).starts_with("-fc1")) { return executeFC1Tool(args); } @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { // Set the environment variable, FLANG_COMPILER_OPTIONS_STRING, to contain all // the compiler options. This is intended for the frontend driver, - // flang-new -fc1, to enable the implementation of the COMPILER_OPTIONS + // flang -fc1, to enable the implementation of the COMPILER_OPTIONS // intrinsic. To this end, the frontend driver requires the list of the // original compiler options, which is not available through other means. // TODO: This way of passing information between the compiler and frontend diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index d948b7eb39b39c..9da1f926817a8b 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -504,15 +504,15 @@ if(build_runtimes) if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES) if (${LLVM_TOOL_FLANG_BUILD}) - message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new") - set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new") + message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang") + set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang") set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang") # TODO: This is a workaround until flang becomes a first-class project - # in llvm/CMakeList.txt. Until then, this line ensures that flang-new is - # built before "openmp" is built as a runtime project. Besides "flang-new" + # in llvm/CMakeList.txt. Until then, this line ensures that flang is + # built before "openmp" is built as a runtime project. Besides "flang" # to build the compiler, we also need to add "module_files" to make sure # that all .mod files are also properly build. - list(APPEND extra_deps "flang-new" "module_files") + list(APPEND extra_deps "flang" "module_files") endif() foreach(dep opt llvm-link llvm-extract clang clang-offload-packager) if(TARGET ${dep}) diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 9ffe8f56b76e67..9b771d1116ee38 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -89,9 +89,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 3b4259dfa380e8..c206386fa6b614 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -69,9 +69,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found >From b71c1d519cc61a751268b1ccda3fc59a966bab96 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 26 Sep 2024 10:39:53 -0500 Subject: [PATCH 2/7] [flang][driver] restore flang-new as symlink Restore flang-new as a symlink to flang for backwards compatibility Co-authored-by: H. Vetinari Co-authored-by: Andrzej Warzynski --- clang/lib/Driver/ToolChain.cpp | 3 +++ flang/tools/flang-driver/CMakeLists.txt | 4 ++++ flang/tools/flang-driver/driver.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 16f9b629fc538c..c9f3dbd7707b77 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -381,6 +381,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { {"cl", "--driver-mode=cl"}, {"++", "--driver-mode=g++"}, {"flang", "--driver-mode=flang"}, + // For backwards compatibility, we create a symlink for `flang` called + // `flang-new`. This will be removed in the future. + {"flang-new", "--driver-mode=flang"}, {"clang-dxc", "--driver-mode=dxc"}, }; diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 615c673374faf4..063acdd7dfe57c 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -36,3 +36,7 @@ if(FLANG_PLUGIN_SUPPORT) endif() install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") + +# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang" +# is a widely adopted name. +add_flang_symlink(flang-new flang) diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 603aab4205836c..ed52988feaa59c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -88,7 +88,8 @@ int main(int argc, const char **argv) { llvm::InitLLVM x(argc, argv); llvm::SmallVector args(argv, argv + argc); - clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang"); + clang::driver::ParsedClangName targetandMode = + clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]); std::string driverPath = getExecutablePath(args[0]); llvm::BumpPtrAllocator a; >From 443c951f8e0458e8b011424fad6a2e4b40b63144 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 30 Sep 2024 10:16:59 -0500 Subject: [PATCH 3/7] [flang][driver] add version to flang executable --- flang/tools/flang-driver/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 063acdd7dfe57c..9a89a6185a3291 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -28,6 +28,12 @@ clang_target_link_libraries(flang clangBasic ) +# This creates the executable with a version appended +# and creates a symlink to it without the version +if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows + set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION}) +endif() + option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) # Enable support for plugins, which need access to symbols from flang >From 27ae40d86f235890d109ca88682dd0caba0d2c93 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 3 Oct 2024 14:12:35 -0700 Subject: [PATCH 4/7] [flang][driver] add warning when using openmp --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 3 +++ clang/include/clang/Basic/DiagnosticGroups.td | 4 ++++ clang/lib/Driver/ToolChains/Flang.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 97573fcf20c1fb..68722ad9633120 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning< def warn_drv_unsupported_openmp_library : Warning< "the library '%0=%1' is not supported, OpenMP will not be enabled">, InGroup; +def warn_openmp_experimental : Warning< + "OpenMP support in flang is still experimental">, + InGroup; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 7d81bdf827ea0c..bfa065f018f8d8 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1582,3 +1582,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">; // Warnings about using the non-standard extension having an explicit specialization // with a storage class specifier. def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">; + +// A warning for options that enable a feature that is not yet complete +def ExperimentalOption : DiagGroup<"experimental-option">; + diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 1ca12ff81389a3..19b43594b00815 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); // FIXME: Clang supports a whole bunch more flags here. break; >From d8f95da5712a7d03a935c8b38f06d373c21f7a1f Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 06:27:05 -0700 Subject: [PATCH 5/7] [flang][doc] update note about CMake support --- flang/docs/FlangDriver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 47cf078cf2d0d4..23cbab30ee903e 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -335,7 +335,7 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a +(CMake 3.28.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use `flang` as follows: ```bash >From a35343fd31314a59f671474474258c8707c123ab Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 07:11:16 -0700 Subject: [PATCH 6/7] [flang][test] fix tests broken by rename --- flang/test/Driver/driver-version.f90 | 2 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/missing-input.f90 | 6 +++--- flang/test/Driver/multiple-input-files.f90 | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index 4c6aecb1c4fa7e..6daeb0e767c0e0 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -9,7 +9,7 @@ ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang{{.*}}: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index bad3d972e6bd6b..be9416810716a9 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang{{.*}}: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 51d37a718c542f..aeefbe14c20563 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -17,10 +17,10 @@ ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang: error: no input files +! FLANG-NO-FILE: flang{{.*}}: error: no input files -! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang: error: no input files +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 64ec8679abf94f..0242db288babf2 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang: error: cannot specify -o when generating multiple output files +! ERROR: flang{{.*}}: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. >From 811b6a7f37f017b0713e6251d95a23c050ab7670 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 07:56:02 -0700 Subject: [PATCH 7/7] [flang][test] add check for OpenMP experimental warning --- flang/test/Driver/fopenmp.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flang/test/Driver/fopenmp.f90 b/flang/test/Driver/fopenmp.f90 index 9b4dc5ffb1f690..b3c3547800bdba 100644 --- a/flang/test/Driver/fopenmp.f90 +++ b/flang/test/Driver/fopenmp.f90 @@ -73,3 +73,7 @@ ! ! CHECK-LD-ANYMD: "{{.*}}ld{{(.exe)?}}" ! CHECK-LD-ANYMD: "-l{{(omp|gomp|iomp5md)}}" +! +! RUN: %flang -fopenmp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-EXPERIMENTAL +! +! CHECK-EXPERIMENTAL: flang{{.*}}: warning: OpenMP support in flang is still experimental From openmp-commits at lists.llvm.org Fri Oct 4 07:57:42 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Fri, 04 Oct 2024 07:57:42 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <67000266.050a0220.17ef4.fe52@mx.google.com> ================ @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); ---------------- everythingfunctional wrote: While I was slightly hesitant to add a test for a temporary warning, I've done so. If anyone else thinks it doesn't belong I'll undo it. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Fri Oct 4 07:59:33 2024 From: openmp-commits at lists.llvm.org (=?UTF-8?Q?Andrzej_Warzy=C5=84ski?= via Openmp-commits) Date: Fri, 04 Oct 2024 07:59:33 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <670002d5.170a0220.2510dd.4a72@mx.google.com> ================ @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(CMake 3.28.0), `cmake` can detect `flang` as a ---------------- banach-space wrote: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246 pre-dates CMake 3.28.0 by quite a few releases, I would just remove the link. @DavidTruby what makes 3.28 special? Should 3.28 be marked as requirement? https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Fri Oct 4 10:06:37 2024 From: openmp-commits at lists.llvm.org (Alexey Bataev via Openmp-commits) Date: Fri, 04 Oct 2024 10:06:37 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030) In-Reply-To: Message-ID: <6700209d.170a0220.366c87.1539@mx.google.com> ================ @@ -16029,6 +16074,44 @@ OMPClause *SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs, SanitizedSizeExprs); } +OMPClause *SemaOpenMP::ActOnOpenMPPermutationClause(ArrayRef PermExprs, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc) { + size_t NumLoops = PermExprs.size(); + SmallVector SanitizedPermExprs; + llvm::append_range(SanitizedPermExprs, PermExprs); + + for (Expr *&PermExpr : SanitizedPermExprs) { + // Skip if template-dependent or already sanitized, e.g. during a partial + // template instantiation. + if (!PermExpr || PermExpr->isInstantiationDependent()) + continue; + + llvm::APSInt PermVal; + ExprResult PermEvalExpr = SemaRef.VerifyIntegerConstantExpression( + PermExpr, &PermVal, Sema::AllowFold); + bool IsValid = PermEvalExpr.isUsable(); + if (IsValid) ---------------- alexey-bataev wrote: ```suggestion if (!IsValid) { PermExpr = nullptr; continue; } ``` ? https://github.com/llvm/llvm-project/pull/92030 From openmp-commits at lists.llvm.org Mon Oct 7 07:18:46 2024 From: openmp-commits at lists.llvm.org (Xing Xue via Openmp-commits) Date: Mon, 07 Oct 2024 07:18:46 -0700 (PDT) Subject: [Openmp-commits] [openmp] [libomp][AIX] Use SO version "1" for AIX libomp (PR #111384) Message-ID: https://github.com/xingxue-ibm created https://github.com/llvm/llvm-project/pull/111384 For `libomp` on AIX, we build shared object `libomp.so` first and then archive it into libomp.a. This patch changes to use SO version `1` and name the shared object `libomp.so.1` so that it is consistent with the naming of other shared objects in AIX libraries, e.g., `libc++.so.1` in `libc++.a`. With this change, the change made in commit bde51d9b0d473447ea12fb14924f14ea167eec85 to ensure only `libomp.a` is published on AIX is no longer necessary and is removed. >From 71cc26f08fb647002e8f7e84d251ac05211dd7a3 Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Fri, 4 Oct 2024 13:57:33 -0400 Subject: [PATCH] Use SO version "1" for AIX libomp. --- openmp/runtime/src/CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 2dd54b5116d920..439cc20963a129 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -212,6 +212,15 @@ if(OPENMP_MSVC_NAME_SCHEME) LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}" LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE} ) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX") + set(LIBOMP_SHARED_OUTPUT_NAME "omp" CACHE STRING "Output name for the shared libomp runtime library.") + set_target_properties(omp PROPERTIES + OUTPUT_NAME "${LIBOMP_SHARED_OUTPUT_NAME}" + LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}" + LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE} + VERSION "1.0" + SOVERSION "1" + ) else() set_target_properties(omp PROPERTIES PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}" @@ -426,11 +435,7 @@ if(WIN32) endforeach() else() - if(${CMAKE_SYSTEM_NAME} MATCHES "AIX") - install(FILES ${LIBOMP_LIBRARY_DIR}/libomp.a DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT runtime) - else() - install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") - endif() + install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") if(${LIBOMP_INSTALL_ALIASES}) # Create aliases (symlinks) of the library for backwards compatibility From openmp-commits at lists.llvm.org Mon Oct 7 09:51:11 2024 From: openmp-commits at lists.llvm.org (Daniel Chen via Openmp-commits) Date: Mon, 07 Oct 2024 09:51:11 -0700 (PDT) Subject: [Openmp-commits] [openmp] [libomp][AIX] Use SO version "1" for AIX libomp (PR #111384) In-Reply-To: Message-ID: <6704117f.170a0220.27d277.e588@mx.google.com> https://github.com/DanielCChen approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/111384 From openmp-commits at lists.llvm.org Tue Oct 8 03:04:16 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Tue, 08 Oct 2024 03:04:16 -0700 (PDT) Subject: [Openmp-commits] [openmp] c62e61a - [libomp][AIX] Use SO version "1" for AIX libomp (#111384) Message-ID: <670503a0.170a0220.acce1.2b6c@mx.google.com> Author: Xing Xue Date: 2024-10-08T06:04:13-04:00 New Revision: c62e61acb428bb46ad834f8288b0c6f8c2ea8d31 URL: https://github.com/llvm/llvm-project/commit/c62e61acb428bb46ad834f8288b0c6f8c2ea8d31 DIFF: https://github.com/llvm/llvm-project/commit/c62e61acb428bb46ad834f8288b0c6f8c2ea8d31.diff LOG: [libomp][AIX] Use SO version "1" for AIX libomp (#111384) For `libomp` on AIX, we build shared object `libomp.so` first and then archive it into libomp.a. This patch changes to use SO version `1` and name the shared object `libomp.so.1` so that it is consistent with the naming of other shared objects in AIX libraries, e.g., `libc++.so.1` in `libc++.a`. With this change, the change made in commit bde51d9b0d473447ea12fb14924f14ea167eec85 to ensure only `libomp.a` is published on AIX is no longer necessary and is removed. Added: Modified: openmp/runtime/src/CMakeLists.txt Removed: ################################################################################ diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 2dd54b5116d920..439cc20963a129 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -212,6 +212,15 @@ if(OPENMP_MSVC_NAME_SCHEME) LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}" LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE} ) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX") + set(LIBOMP_SHARED_OUTPUT_NAME "omp" CACHE STRING "Output name for the shared libomp runtime library.") + set_target_properties(omp PROPERTIES + OUTPUT_NAME "${LIBOMP_SHARED_OUTPUT_NAME}" + LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}" + LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE} + VERSION "1.0" + SOVERSION "1" + ) else() set_target_properties(omp PROPERTIES PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}" @@ -426,11 +435,7 @@ if(WIN32) endforeach() else() - if(${CMAKE_SYSTEM_NAME} MATCHES "AIX") - install(FILES ${LIBOMP_LIBRARY_DIR}/libomp.a DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT runtime) - else() - install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") - endif() + install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") if(${LIBOMP_INSTALL_ALIASES}) # Create aliases (symlinks) of the library for backwards compatibility From openmp-commits at lists.llvm.org Tue Oct 8 03:04:20 2024 From: openmp-commits at lists.llvm.org (Xing Xue via Openmp-commits) Date: Tue, 08 Oct 2024 03:04:20 -0700 (PDT) Subject: [Openmp-commits] [openmp] [libomp][AIX] Use SO version "1" for AIX libomp (PR #111384) In-Reply-To: Message-ID: <670503a4.620a0220.17b39d.2dbd@mx.google.com> https://github.com/xingxue-ibm closed https://github.com/llvm/llvm-project/pull/111384 From openmp-commits at lists.llvm.org Tue Oct 8 08:30:53 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Tue, 08 Oct 2024 08:30:53 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Add option to disable tsan tests (PR #111548) Message-ID: https://github.com/nikic created https://github.com/llvm/llvm-project/pull/111548 This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override whether tests using tsan will be enabled. The option defaults to the existing auto-detection. The background here is https://github.com/llvm/llvm-project/issues/111492, where we have some systems where tsan doesn't work, but we do still want to build it. >From 0d22314aac0875c6b6e748a2a87dddfa68f8416a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 8 Oct 2024 17:12:52 +0200 Subject: [PATCH] [openmp] Add option to disable tsan tests This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override whether tests using tsan will be enabled. The option defaults to the existing auto-detection. --- openmp/cmake/OpenMPTesting.cmake | 3 +++ openmp/tools/archer/tests/CMakeLists.txt | 2 +- openmp/tools/archer/tests/lit.site.cfg.in | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake index c67ad8b1cbd9cc..14cc5c67d84c2d 100644 --- a/openmp/cmake/OpenMPTesting.cmake +++ b/openmp/cmake/OpenMPTesting.cmake @@ -163,6 +163,9 @@ else() set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) endif() +set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL + "Whether to enable tests using tsan") + # Function to set compiler features for use in lit. function(update_test_compiler_features) set(FEATURES "[") diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt index 5de91148fa4b38..412c7d63725eb2 100644 --- a/openmp/tools/archer/tests/CMakeLists.txt +++ b/openmp/tools/archer/tests/CMakeLists.txt @@ -28,7 +28,7 @@ macro(pythonize_bool var) endmacro() pythonize_bool(LIBARCHER_HAVE_LIBATOMIC) -pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS) +pythonize_bool(OPENMP_TEST_ENABLE_TSAN) set(ARCHER_TSAN_TEST_DEPENDENCE "") if(TARGET tsan) diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in index 55edfde9738e3b..ddcb7b8bc3a56b 100644 --- a/openmp/tools/archer/tests/lit.site.cfg.in +++ b/openmp/tools/archer/tests/lit.site.cfg.in @@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@" config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@" config.operating_system = "@CMAKE_SYSTEM_NAME@" config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@ -config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@ +config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@ config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@" config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@" From openmp-commits at lists.llvm.org Tue Oct 8 08:33:24 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Tue, 08 Oct 2024 08:33:24 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Add option to disable tsan tests (PR #111548) In-Reply-To: Message-ID: <670550c4.170a0220.336069.43cf@mx.google.com> https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/111548 From openmp-commits at lists.llvm.org Tue Oct 8 08:35:12 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Tue, 08 Oct 2024 08:35:12 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Add option to disable tsan tests (PR #111548) In-Reply-To: Message-ID: <67055130.050a0220.17fb49.7c1d@mx.google.com> https://github.com/jprotze approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/111548 From openmp-commits at lists.llvm.org Tue Oct 8 08:53:52 2024 From: openmp-commits at lists.llvm.org (Michael Kruse via Openmp-commits) Date: Tue, 08 Oct 2024 08:53:52 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030) In-Reply-To: Message-ID: <67055590.170a0220.16e512.30f3@mx.google.com> ================ @@ -16029,6 +16074,44 @@ OMPClause *SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs, SanitizedSizeExprs); } +OMPClause *SemaOpenMP::ActOnOpenMPPermutationClause(ArrayRef PermExprs, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc) { + size_t NumLoops = PermExprs.size(); + SmallVector SanitizedPermExprs; + llvm::append_range(SanitizedPermExprs, PermExprs); + + for (Expr *&PermExpr : SanitizedPermExprs) { + // Skip if template-dependent or already sanitized, e.g. during a partial + // template instantiation. + if (!PermExpr || PermExpr->isInstantiationDependent()) + continue; + + llvm::APSInt PermVal; + ExprResult PermEvalExpr = SemaRef.VerifyIntegerConstantExpression( + PermExpr, &PermVal, Sema::AllowFold); + bool IsValid = PermEvalExpr.isUsable(); + if (IsValid) ---------------- Meinersbur wrote: In partial template instantiations the expression may not evaluate to a constant yet because it depends on another template parameter. We cannot set `PermExpr` to nullptr because we need to preserve the expression to be evaluated at another call to `ActOnOpenMPPermutationClause` when the template is fully instantiated. https://github.com/llvm/llvm-project/pull/92030 From openmp-commits at lists.llvm.org Tue Oct 8 09:02:33 2024 From: openmp-commits at lists.llvm.org (Alexey Bataev via Openmp-commits) Date: Tue, 08 Oct 2024 09:02:33 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030) In-Reply-To: Message-ID: <67055799.a70a0220.caebc.66e8@mx.google.com> https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/92030 From openmp-commits at lists.llvm.org Tue Oct 8 09:12:12 2024 From: openmp-commits at lists.llvm.org (Kiran Chandramohan via Openmp-commits) Date: Tue, 08 Oct 2024 09:12:12 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <670559dc.170a0220.347f51.bd33@mx.google.com> https://github.com/kiranchandramohan approved this pull request. LGTM. Thanks for adding the warning about OpenMP. Please ask in the Flang community call tomorrow and in the discourse post before you submit. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Wed Oct 9 02:29:33 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Wed, 09 Oct 2024 02:29:33 -0700 (PDT) Subject: [Openmp-commits] [openmp] b2edeb5 - [openmp] Add option to disable tsan tests (#111548) Message-ID: <67064cfd.050a0220.369330.a4fe@mx.google.com> Author: Nikita Popov Date: 2024-10-09T11:29:30+02:00 New Revision: b2edeb58b8cb3268acee425cd52b406eb60a8095 URL: https://github.com/llvm/llvm-project/commit/b2edeb58b8cb3268acee425cd52b406eb60a8095 DIFF: https://github.com/llvm/llvm-project/commit/b2edeb58b8cb3268acee425cd52b406eb60a8095.diff LOG: [openmp] Add option to disable tsan tests (#111548) This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override whether tests using tsan will be enabled. The option defaults to the existing auto-detection. The background here is https://github.com/llvm/llvm-project/issues/111492, where we have some systems where tsan doesn't work, but we do still want to build it and run tests that don't use tsan. Added: Modified: openmp/cmake/OpenMPTesting.cmake openmp/tools/archer/tests/CMakeLists.txt openmp/tools/archer/tests/lit.site.cfg.in Removed: ################################################################################ diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake index c67ad8b1cbd9cc..14cc5c67d84c2d 100644 --- a/openmp/cmake/OpenMPTesting.cmake +++ b/openmp/cmake/OpenMPTesting.cmake @@ -163,6 +163,9 @@ else() set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) endif() +set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL + "Whether to enable tests using tsan") + # Function to set compiler features for use in lit. function(update_test_compiler_features) set(FEATURES "[") diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt index 5de91148fa4b38..412c7d63725eb2 100644 --- a/openmp/tools/archer/tests/CMakeLists.txt +++ b/openmp/tools/archer/tests/CMakeLists.txt @@ -28,7 +28,7 @@ macro(pythonize_bool var) endmacro() pythonize_bool(LIBARCHER_HAVE_LIBATOMIC) -pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS) +pythonize_bool(OPENMP_TEST_ENABLE_TSAN) set(ARCHER_TSAN_TEST_DEPENDENCE "") if(TARGET tsan) diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in index 55edfde9738e3b..ddcb7b8bc3a56b 100644 --- a/openmp/tools/archer/tests/lit.site.cfg.in +++ b/openmp/tools/archer/tests/lit.site.cfg.in @@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@" config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@" config.operating_system = "@CMAKE_SYSTEM_NAME@" config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@ -config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@ +config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@ config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@" config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@" From openmp-commits at lists.llvm.org Wed Oct 9 02:29:38 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Wed, 09 Oct 2024 02:29:38 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Add option to disable tsan tests (PR #111548) In-Reply-To: Message-ID: <67064d02.170a0220.2c27de.2d03@mx.google.com> https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/111548 From openmp-commits at lists.llvm.org Wed Oct 9 05:57:06 2024 From: openmp-commits at lists.llvm.org (Michael Kruse via Openmp-commits) Date: Wed, 09 Oct 2024 05:57:06 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030) In-Reply-To: Message-ID: <67067da2.170a0220.12b5df.9026@mx.google.com> https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/92030 From openmp-commits at lists.llvm.org Wed Oct 9 11:00:56 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Wed, 09 Oct 2024 11:00:56 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6706c4d8.170a0220.19ac54.4f76@mx.google.com> https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From c19e89f7358dc638687be4da8f5a51cb483b3637 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/7] [flang][driver] rename flang-new to flang --- .github/workflows/release-binaries.yml | 2 +- clang/include/clang/Driver/Options.td | 4 +- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Driver/ToolChains/Flang.cpp | 6 +- clang/test/Driver/flang/flang.f90 | 2 +- clang/test/Driver/flang/flang_ucase.F90 | 2 +- .../Driver/flang/multiple-inputs-mixed.f90 | 2 +- clang/test/Driver/flang/multiple-inputs.f90 | 4 +- flang/docs/FlangDriver.md | 76 +++++++++---------- flang/docs/ImplementingASemanticCheck.md | 4 +- flang/docs/Overview.md | 26 +++---- .../FlangOmpReport/FlangOmpReport.cpp | 2 +- .../flang/Optimizer/Analysis/AliasAnalysis.h | 2 +- flang/include/flang/Tools/CrossToolHelpers.h | 2 +- flang/lib/Frontend/CompilerInvocation.cpp | 6 +- flang/lib/Frontend/FrontendActions.cpp | 2 +- .../ExecuteCompilerInvocation.cpp | 3 +- flang/runtime/CMakeLists.txt | 6 +- flang/test/CMakeLists.txt | 2 +- flang/test/Driver/aarch64-outline-atomics.f90 | 2 +- .../Driver/color-diagnostics-forwarding.f90 | 4 +- flang/test/Driver/compiler-options.f90 | 4 +- flang/test/Driver/convert.f90 | 2 +- .../test/Driver/disable-ext-name-interop.f90 | 2 +- flang/test/Driver/driver-version.f90 | 4 +- flang/test/Driver/escaped-backslash.f90 | 4 +- flang/test/Driver/fdefault.f90 | 28 +++---- flang/test/Driver/flarge-sizes.f90 | 20 ++--- .../test/Driver/frame-pointer-forwarding.f90 | 2 +- flang/test/Driver/frontend-forwarding.f90 | 4 +- flang/test/Driver/hlfir-no-hlfir-error.f90 | 4 +- flang/test/Driver/intrinsic-module-path.f90 | 2 +- flang/test/Driver/large-data-threshold.f90 | 6 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/macro-def-undef.F90 | 4 +- flang/test/Driver/missing-input.f90 | 14 ++-- flang/test/Driver/multiple-input-files.f90 | 2 +- flang/test/Driver/omp-driver-offload.f90 | 66 ++++++++-------- .../predefined-macros-compiler-version.F90 | 4 +- flang/test/Driver/std2018-wrong.f90 | 2 +- flang/test/Driver/std2018.f90 | 2 +- .../Driver/supported-suffices/f03-suffix.f03 | 2 +- .../Driver/supported-suffices/f08-suffix.f08 | 2 +- flang/test/Driver/use-module-error.f90 | 4 +- flang/test/Driver/use-module.f90 | 4 +- flang/test/Driver/version-loops.f90 | 18 ++--- flang/test/Driver/wextra-ok.f90 | 2 +- flang/test/HLFIR/hlfir-flags.f90 | 2 +- .../Intrinsics/command_argument_count.f90 | 4 +- flang/test/Lower/Intrinsics/exit.f90 | 2 +- .../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +- flang/test/Lower/Intrinsics/isnan.f90 | 2 +- flang/test/Lower/Intrinsics/modulo.f90 | 2 +- .../OpenMP/Todo/omp-declarative-allocate.f90 | 2 +- .../OpenMP/Todo/omp-declare-reduction.f90 | 2 +- .../Lower/OpenMP/Todo/omp-declare-simd.f90 | 2 +- .../parallel-lastprivate-clause-scalar.f90 | 2 +- .../parallel-wsloop-reduction-byref.f90 | 2 +- .../OpenMP/parallel-wsloop-reduction.f90 | 2 +- flang/test/lit.cfg.py | 4 +- flang/tools/f18/CMakeLists.txt | 10 +-- flang/tools/flang-driver/CMakeLists.txt | 12 +-- flang/tools/flang-driver/driver.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 10 +-- offload/CMakeLists.txt | 4 +- openmp/CMakeLists.txt | 4 +- 66 files changed, 220 insertions(+), 227 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index f24e25879b96bd..1cde628d3f66c3 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -328,7 +328,7 @@ jobs: run: | # Build some of the mlir tools that take a long time to link if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc fi ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \ mlir-bytecode-parser-fuzzer \ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 90f0c4f2df2130..8fb9edd7a2a927 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6077,7 +6077,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; //===----------------------------------------------------------------------===// -// pie/pic options (clang + flang-new) +// pie/pic options (clang + flang) //===----------------------------------------------------------------------===// let Visibility = [ClangOption, FlangOption] in { @@ -6093,7 +6093,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group; } // let Vis = [Default, FlangOption] //===----------------------------------------------------------------------===// -// Target Options (clang + flang-new) +// Target Options (clang + flang) //===----------------------------------------------------------------------===// let Flags = [TargetSpecific] in { let Visibility = [ClangOption, FlangOption] in { diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index a5d43bdac23735..ba850cf3803e9b 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2029,7 +2029,7 @@ void Driver::PrintHelp(bool ShowHidden) const { void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { if (IsFlangMode()) { - OS << getClangToolFullVersion("flang-new") << '\n'; + OS << getClangToolFullVersion("flang") << '\n'; } else { // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 98350690f8d20e..1ca12ff81389a3 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -881,14 +881,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); - // TODO: Replace flang-new with flang once the new driver replaces the - // throwaway driver - const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC)); + const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs, Output)); } -Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {} +Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {} diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90 index ad4a3a3b6bd44d..b52977ee66d7b0 100644 --- a/clang/test/Driver/flang/flang.f90 +++ b/clang/test/Driver/flang/flang.f90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/flang_ucase.F90 b/clang/test/Driver/flang/flang_ucase.F90 index e89c053b327bc9..88aedc39fb94a7 100644 --- a/clang/test/Driver/flang/flang_ucase.F90 +++ b/clang/test/Driver/flang/flang_ucase.F90 @@ -13,7 +13,7 @@ ! * (no type specified, resulting in an object file) ! All invocations should begin with flang -fc1, consume up to here. -! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! Check that f90 files are not treated as "previously preprocessed" ! ... in --driver-mode=flang. diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/clang/test/Driver/flang/multiple-inputs-mixed.f90 index 2395dbecf1fe92..98d8cab00bdfdb 100644 --- a/clang/test/Driver/flang/multiple-inputs-mixed.f90 +++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90 @@ -1,7 +1,7 @@ ! Check that flang can handle mixed C and fortran inputs. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c" diff --git a/clang/test/Driver/flang/multiple-inputs.f90 b/clang/test/Driver/flang/multiple-inputs.f90 index ada999e927a6a0..3c0f22e5d3e508 100644 --- a/clang/test/Driver/flang/multiple-inputs.f90 +++ b/clang/test/Driver/flang/multiple-inputs.f90 @@ -1,7 +1,7 @@ ! Check that flang driver can handle multiple inputs at once. ! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90" -! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1" +! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1" ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90" diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 815c26a28dfdfa..47cf078cf2d0d4 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: -* the compiler driver, `flang-new` -* the frontend driver, `flang-new -fc1` - -> **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the -> diagrams reflect the final design that we are still working towards. +* the compiler driver, `flang` +* the frontend driver, `flang -fc1` The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering and linking). For frontend specific tasks, the compiler driver creates a -Fortran compilation job and delegates it to `flang-new -fc1`, the frontend +Fortran compilation job and delegates it to `flang -fc1`, the frontend driver. For linking, it creates a linker job and calls an external linker (e.g. LLVM's [`lld`](https://lld.llvm.org/)). It can also call other tools such as external assemblers (e.g. [`as`](https://www.gnu.org/software/binutils/)). In @@ -47,7 +43,7 @@ frontend. It uses MLIR and LLVM for code-generation and can be viewed as a driver for Flang, LLVM and MLIR libraries. Contrary to the compiler driver, it is not capable of calling any external tools (including linkers). It is aware of all the frontend internals that are "hidden" from the compiler driver. It -accepts many frontend-specific options not available in `flang-new` and as such +accepts many frontend-specific options not available in `flang` and as such it provides a finer control over the frontend. Note that this tool is mostly intended for Flang developers. In particular, there are no guarantees about the stability of its interface and compiler developers can use it to experiment @@ -62,30 +58,30 @@ frontend specific flag from the _compiler_ directly to the _frontend_ driver, e.g.: ```bash -flang-new -Xflang -fdebug-dump-parse-tree input.f95 +flang -Xflang -fdebug-dump-parse-tree input.f95 ``` -In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang-new +In the invocation above, `-fdebug-dump-parse-tree` is forwarded to `flang -fc1`. Without the forwarding flag, `-Xflang`, you would see the following warning: ```bash -flang-new: warning: argument unused during compilation: +flang: warning: argument unused during compilation: ``` -As `-fdebug-dump-parse-tree` is only supported by `flang-new -fc1`, `flang-new` +As `-fdebug-dump-parse-tree` is only supported by `flang -fc1`, `flang` will ignore it when used without `Xflang`. ## Why Do We Need Two Drivers? -As hinted above, `flang-new` and `flang-new -fc1` are two separate tools. The -fact that these tools are accessed through one binary, `flang-new`, is just an +As hinted above, `flang` and `flang -fc1` are two separate tools. The +fact that these tools are accessed through one binary, `flang`, is just an implementation detail. Each tool has a separate list of options, albeit defined in the same file: `clang/include/clang/Driver/Options.td`. The separation helps us split various tasks and allows us to implement more -specialised tools. In particular, `flang-new` is not aware of various +specialised tools. In particular, `flang` is not aware of various compilation phases within the frontend (e.g. scanning, parsing or semantic -checks). It does not have to be. Conversely, the frontend driver, `flang-new +checks). It does not have to be. Conversely, the frontend driver, `flang -fc1`, needs not to be concerned with linkers or other external tools like assemblers. Nor does it need to know where to look for various systems libraries, which is usually OS and platform specific. @@ -104,7 +100,7 @@ GCC](https://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/GNU_C_Compiler_Archi In fact, Flang needs to adhere to this model in order to be able to re-use Clang's driver library. If you are more familiar with the [architecture of GFortran](https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gfortran/About-GNU-Fortran.html) -than Clang, then `flang-new` corresponds to `gfortran` and `flang-new -fc1` to +than Clang, then `flang` corresponds to `gfortran` and `flang -fc1` to `f951`. ## Compiler Driver @@ -135,7 +131,7 @@ output from one action is the input for the subsequent one. You can use the `-ccc-print-phases` flag to see the sequence of actions that the driver will create for your compiler invocation: ```bash -flang-new -ccc-print-phases -E file.f +flang -ccc-print-phases -E file.f +- 0: input, "file.f", f95-cpp-input 1: preprocessor, {0}, f95 ``` @@ -143,7 +139,7 @@ As you can see, for `-E` the driver creates only two jobs and stops immediately after preprocessing. The first job simply prepares the input. For `-c`, the pipeline of the created jobs is more complex: ```bash -flang-new -ccc-print-phases -c file.f +flang -ccc-print-phases -c file.f +- 0: input, "file.f", f95-cpp-input +- 1: preprocessor, {0}, f95 +- 2: compiler, {1}, ir @@ -158,7 +154,7 @@ command to call the frontend driver is generated (more specifically, an instance of `clang::driver::Command`). Every command is bound to an instance of `clang::driver::Tool`. For Flang we introduced a specialisation of this class: `clang::driver::Flang`. This class implements the logic to either translate or -forward compiler options to the frontend driver, `flang-new -fc1`. +forward compiler options to the frontend driver, `flang -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). @@ -232,12 +228,12 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/driver.cpp`. It can be accessed by -invoking the compiler driver, `flang-new`, with the `-fc1` flag. +invoking the compiler driver, `flang`, with the `-fc1` flag. The frontend driver will only run one action at a time. If you specify multiple action flags, only the last one will be taken into account. The default action is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other -words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only +words, `flang -fc1 ` is equivalent to `flang -fc1 -fsyntax-only `. ## Adding new Compiler Options @@ -262,8 +258,8 @@ similar semantics to your new option and start by copying that. For every new option, you will also have to define the visibility of the new option. This is controlled through the `Visibility` field. You can use the following Flang specific visibility flags to control this: - * `FlangOption` - this option will be available in the `flang-new` compiler driver, - * `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver, + * `FlangOption` - this option will be available in the `flang` compiler driver, + * `FC1Option` - this option will be available in the `flang -fc1` frontend driver, Options that are supported by clang should explicitly specify `ClangOption` in `Visibility`, and options that are only supported in Flang should not specify @@ -290,10 +286,10 @@ The parsing will depend on the semantics encoded in the TableGen definition. When adding a compiler driver option (i.e. an option that contains `FlangOption` among in it's `Visibility`) that you also intend to be understood -by the frontend, make sure that it is either forwarded to `flang-new -fc1` or +by the frontend, make sure that it is either forwarded to `flang -fc1` or translated into some other option that is accepted by the frontend driver. In the case of options that contain both `FlangOption` and `FC1Option` among its -flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is +flags, we usually just forward from `flang` to `flang -fc1`. This is then tested in `flang/test/Driver/frontend-forward.F90`. What follows is usually very dependant on the meaning of the corresponding @@ -339,11 +335,11 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang-new` as a +(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use -`flang-new` as follows: +`flang` as follows: ```bash -cmake -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` @@ -353,14 +349,14 @@ where `` corresponds to the LLVM Flang version. ## Testing In LIT, we define two variables that you can use to invoke Flang's drivers: -* `%flang` is expanded as `flang-new` (i.e. the compiler driver) -* `%flang_fc1` is expanded as `flang-new -fc1` (i.e. the frontend driver) +* `%flang` is expanded as `flang` (i.e. the compiler driver) +* `%flang_fc1` is expanded as `flang -fc1` (i.e. the frontend driver) For most regression tests for the frontend, you will want to use `%flang_fc1`. In some cases, the observable behaviour will be identical regardless of whether `%flang` or `%flang_fc1` is used. However, when you are using `%flang` instead of `%flang_fc1`, the compiler driver will add extra flags to the frontend -driver invocation (i.e. `flang-new -fc1 -`). In some cases that might +driver invocation (i.e. `flang -fc1 -`). In some cases that might be exactly what you want to test. In fact, you can check these additional flags by using the `-###` compiler driver command line option. @@ -380,7 +376,7 @@ plugins. The process for using plugins includes: * [Creating a plugin](#creating-a-plugin) * [Loading and running a plugin](#loading-and-running-a-plugin) -Flang plugins are limited to `flang-new -fc1` and are currently only available / +Flang plugins are limited to `flang -fc1` and are currently only available / been tested on Linux. ### Creating a Plugin @@ -465,14 +461,14 @@ static FrontendPluginRegistry::Add X( ### Loading and Running a Plugin In order to use plugins, there are 2 command line options made available to the -frontend driver, `flang-new -fc1`: +frontend driver, `flang -fc1`: * [`-load `](#the--load-dsopath-option) for loading the dynamic shared object of the plugin * [`-plugin `](#the--plugin-name-option) for calling the registered plugin Invocation of the example plugin is done through: ```bash -flang-new -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 +flang -fc1 -load flangPrintFunctionNames.so -plugin print-fns file.f90 ``` Both these options are parsed in `flang/lib/Frontend/CompilerInvocation.cpp` and @@ -493,7 +489,7 @@ reports an error diagnostic and returns `nullptr`. ### Enabling In-Tree Plugins For in-tree plugins, there is the CMake flag `FLANG_PLUGIN_SUPPORT`, enabled by -default, that controls the exporting of executable symbols from `flang-new`, +default, that controls the exporting of executable symbols from `flang`, which plugins need access to. Additionally, there is the CMake flag `LLVM_BUILD_EXAMPLES`, turned off by default, that is used to control if the example programs are built. This includes plugins that are in the @@ -526,7 +522,7 @@ invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and `invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal passes at different points of the default pass pipeline. An example use of these extension point callbacks is shown in `registerDefaultInlinerPass` to invoke the -default inliner pass in `flang-new`. +default inliner pass in `flang`. ## LLVM Pass Plugins @@ -539,7 +535,7 @@ documentation for [`llvm::PassBuilder`](https://llvm.org/doxygen/classllvm_1_1PassBuilder.html) for details. -The framework to enable pass plugins in `flang-new` uses the exact same +The framework to enable pass plugins in `flang` uses the exact same machinery as that used by `clang` and thus has the same capabilities and limitations. @@ -547,7 +543,7 @@ In order to use a pass plugin, the pass(es) must be compiled into a dynamic shared object which is then loaded using the `-fpass-plugin` option. ``` -flang-new -fpass-plugin=/path/to/plugin.so +flang -fpass-plugin=/path/to/plugin.so ``` This option is available in both the compiler driver and the frontend driver. @@ -559,7 +555,7 @@ Pass extensions are similar to plugins, except that they can also be linked statically. Setting `-DLLVM_${NAME}_LINK_INTO_TOOLS` to `ON` in the cmake command turns the project into a statically linked extension. An example would be Polly, e.g., using `-DLLVM_POLLY_LINK_INTO_TOOLS=ON` would link Polly passes -into `flang-new` as built-in middle-end passes. +into `flang` as built-in middle-end passes. See the [`WritingAnLLVMNewPMPass`](https://llvm.org/docs/WritingAnLLVMNewPMPass.html#id9) diff --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md index 5b583d4f8031b8..598ef696ad14bf 100644 --- a/flang/docs/ImplementingASemanticCheck.md +++ b/flang/docs/ImplementingASemanticCheck.md @@ -68,7 +68,7 @@ of the call to `intentOutFunc()`: I also used this program to produce a parse tree for the program using the command: ```bash - flang-new -fc1 -fdebug-dump-parse-tree testfun.f90 + flang -fc1 -fdebug-dump-parse-tree testfun.f90 ``` Here's the relevant fragment of the parse tree produced by the compiler: @@ -296,7 +296,7 @@ In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation: I then built the compiler with these changes and ran it on my test program. This time, I made sure to invoke semantic checking. Here's the command I used: ```bash - flang-new -fc1 -fdebug-unparse-with-symbols testfun.f90 + flang -fc1 -fdebug-unparse-with-symbols testfun.f90 ``` This produced the output: diff --git a/flang/docs/Overview.md b/flang/docs/Overview.md index 6eba19ea3a3c0d..dfb4d89264a755 100644 --- a/flang/docs/Overview.md +++ b/flang/docs/Overview.md @@ -65,8 +65,8 @@ See [Preprocessing.md](Preprocessing.md). **Entry point:** `parser::Parsing::Prescan` **Commands:** - - `flang-new -fc1 -E src.f90` dumps the cooked character stream - - `flang-new -fc1 -fdebug-dump-provenance src.f90` dumps provenance + - `flang -fc1 -E src.f90` dumps the cooked character stream + - `flang -fc1 -fdebug-dump-provenance src.f90` dumps provenance information ### Parsing @@ -80,10 +80,10 @@ representing a syntactically correct program, rooted at the program unit. See: **Entry point:** `parser::Parsing::Parse` **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree - - `flang-new -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran - - `flang-new -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log - - `flang-new -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree + - `flang -fc1 -fdebug-dump-parse-tree-no-sema src.f90` dumps the parse tree + - `flang -fc1 -fdebug-unparse src.f90` converts the parse tree to normalized Fortran + - `flang -fc1 -fdebug-dump-parsing-log src.f90` runs an instrumented parse and dumps the log + - `flang -fc1 -fdebug-measure-parse-tree src.f90` measures the parse tree ### Semantic processing @@ -121,9 +121,9 @@ In the course of semantic analysis, the compiler: At the end of semantic processing, all validation of the user's program is complete. This is the last detailed phase of analysis processing. **Commands:** - - `flang-new -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis - - `flang-new -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table - - `flang-new -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table + - `flang -fc1 -fdebug-dump-parse-tree src.f90` dumps the parse tree after semantic analysis + - `flang -fc1 -fdebug-dump-symbols src.f90` dumps the symbol table + - `flang -fc1 -fdebug-dump-all src.f90` dumps both the parse tree and the symbol table ## Lowering @@ -163,8 +163,8 @@ contain a list of evaluations. All of these contain pointers back into the parse tree. The compiler walks the PFT generating FIR. **Commands:** - - `flang-new -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree - - `flang-new -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir + - `flang -fc1 -fdebug-dump-pft src.f90` dumps the pre-FIR tree + - `flang -fc1 -emit-mlir src.f90` dumps the FIR to the files src.mlir ### Transformation passes @@ -180,8 +180,8 @@ perform various optimizations and transformations. The final pass creates an LLVM IR representation of the program. **Commands:** - - `flang-new -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error - - `flang-new -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll + - `flang -mmlir --mlir-print-ir-after-all -S src.f90` dumps the FIR code after each pass to standard error + - `flang -fc1 -emit-llvm src.f90` dumps the LLVM IR to src.ll ## Object code generation and linking diff --git a/flang/examples/FlangOmpReport/FlangOmpReport.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp index 9c1f304b9741e7..709c5c5d305e51 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReport.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp @@ -9,7 +9,7 @@ // all the OpenMP constructs and clauses and which line they're located on. // // The plugin may be invoked as: -// ./bin/flang-new -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report +// ./bin/flang -fc1 -load lib/flangOmpReport.so -plugin flang-omp-report // -fopenmp // //===----------------------------------------------------------------------===// diff --git a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h index 9a70b7fbfad2b6..8ab5150cd7c812 100644 --- a/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h +++ b/flang/include/flang/Optimizer/Analysis/AliasAnalysis.h @@ -67,7 +67,7 @@ struct AliasAnalysis { // end subroutine // ------------------------------------------------- // - // flang-new -fc1 -emit-fir test.f90 -o test.fir + // flang -fc1 -emit-fir test.f90 -o test.fir // // ------------------- test.fir -------------------- // fir.global @_QMtopEa : !fir.box>> diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h index 3e703de545950c..df4b21ada058fe 100644 --- a/flang/include/flang/Tools/CrossToolHelpers.h +++ b/flang/include/flang/Tools/CrossToolHelpers.h @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // A header file for containing functionallity that is used across Flang tools, // such as helper functions which apply or generate information needed accross -// tools like bbc and flang-new. +// tools like bbc and flang. //===----------------------------------------------------------------------===// #ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 2154b9ab2fbf47..849c6f53614f63 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -66,8 +66,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static bool parseShowColorsArgs(const llvm::opt::ArgList &args, bool defaultColor = true) { // Color diagnostics default to auto ("on" if terminal supports) in the - // compiler driver `flang-new` but default to off in the frontend driver - // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color. + // compiler driver `flang` but default to off in the frontend driver + // `flang -fc1`, needing an explicit OPT_fdiagnostics_color. // Support both clang's -f[no-]color-diagnostics and gcc's // -f[no-]diagnostics-colors[=never|always|auto]. enum { @@ -900,7 +900,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, } } - // Default to off for `flang-new -fc1`. + // Default to off for `flang -fc1`. res.getFrontendOpts().showColors = parseShowColorsArgs(args, /*defaultDiagColor=*/false); diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 4a52edc436e0ed..8f882bff170909 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -233,7 +233,7 @@ bool CodeGenAction::beginSourceFileAction() { llvm::SMDiagnostic err; llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx); if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) { - err.print("flang-new", llvm::errs()); + err.print("flang", llvm::errs()); unsigned diagID = ci.getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Error, "Could not parse IR"); ci.getDiagnostics().Report(diagID); diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index e2cbd5112d6ea5..09ac129d3e6893 100644 --- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) { // Honor -help. if (flang->getFrontendOpts().showHelp) { clang::driver::getDriverOptTable().printHelp( - llvm::outs(), "flang-new -fc1 [options] file...", - "LLVM 'Flang' Compiler", + llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler", /*ShowHidden=*/false, /*ShowAllAliases=*/false, llvm::opt::Visibility(clang::driver::options::FC1Option)); return true; diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 0ad1b718d5875b..cdd2de541c6730 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -308,12 +308,12 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries" # If FortranRuntime is part of a Flang build (and not a separate build) then # add dependency to make sure that Fortran runtime library is being built after # we have the Flang compiler available. This also includes the MODULE files -# that compile when the 'flang-new' target is built. +# that compile when the 'flang' target is built. # # TODO: This is a workaround and should be updated when runtime build procedure # is changed to a regular runtime build. See discussion in PR #95388. -if (TARGET flang-new AND TARGET module_files) - add_dependencies(FortranRuntime flang-new module_files) +if (TARGET flang AND TARGET module_files) + add_dependencies(FortranRuntime flang module_files) endif() if (FLANG_CUF_RUNTIME) diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index a18a5c6519eda4..cab214c2ef4c8c 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -58,7 +58,7 @@ set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) set(FLANG_TEST_DEPENDS - flang-new + flang llvm-config FileCheck count diff --git a/flang/test/Driver/aarch64-outline-atomics.f90 b/flang/test/Driver/aarch64-outline-atomics.f90 index a1c874c20df5c7..530bfc8e962091 100644 --- a/flang/test/Driver/aarch64-outline-atomics.f90 +++ b/flang/test/Driver/aarch64-outline-atomics.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! Test that flang forwards the -moutline-atomics and -mno-outline-atomics. ! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s ! CHECK: "-target-feature" "+outline-atomics" diff --git a/flang/test/Driver/color-diagnostics-forwarding.f90 b/flang/test/Driver/color-diagnostics-forwarding.f90 index 368fa8834142ab..29061242cb0cbc 100644 --- a/flang/test/Driver/color-diagnostics-forwarding.f90 +++ b/flang/test/Driver/color-diagnostics-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards -f{no-}color-diagnostics and -! -f{no-}diagnostics-color options to flang-new -fc1 as expected. +! Test that flang forwards -f{no-}color-diagnostics and +! -f{no-}diagnostics-color options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \ ! RUN: | FileCheck %s --check-prefix=CHECK-CD diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90 index 7ec29ce7ba7abf..cefa86836abd30 100644 --- a/flang/test/Driver/compiler-options.f90 +++ b/flang/test/Driver/compiler-options.f90 @@ -1,6 +1,6 @@ ! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s -! Test communication of COMPILER_OPTIONS from flang-new to flang-new -fc1. -! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang-new{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" +! Test communication of COMPILER_OPTIONS from flang to flang -fc1. +! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90" program main use ISO_FORTRAN_ENV, only: compiler_options implicit none diff --git a/flang/test/Driver/convert.f90 b/flang/test/Driver/convert.f90 index b2cf6c23efdb75..0ba31d2188cdf5 100755 --- a/flang/test/Driver/convert.f90 +++ b/flang/test/Driver/convert.f90 @@ -12,7 +12,7 @@ ! RUN: not %flang -fconvert=foobar %s 2>&1 | FileCheck %s --check-prefix=INVALID !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -emit-mlir -fconvert=unknown %s -o - | FileCheck %s --check-prefix=VALID_FC1 ! RUN: %flang_fc1 -emit-mlir -fconvert=native %s -o - | FileCheck %s --check-prefix=VALID_FC1 diff --git a/flang/test/Driver/disable-ext-name-interop.f90 b/flang/test/Driver/disable-ext-name-interop.f90 index 0c59a5b4c980f8..1ade84b996d043 100644 --- a/flang/test/Driver/disable-ext-name-interop.f90 +++ b/flang/test/Driver/disable-ext-name-interop.f90 @@ -1,4 +1,4 @@ -! Test that we can disable the ExternalNameConversion pass in flang-new. +! Test that we can disable the ExternalNameConversion pass in flang. ! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=EXTNAMES ! RUN: %flang_fc1 -S -mmlir -disable-external-name-interop %s -o - 2>&1 | FileCheck %s --check-prefix=INTNAMES diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index d1e1e1d90fe1f8..4c6aecb1c4fa7e 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -4,12 +4,12 @@ ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 -! VERSION: flang-new version +! VERSION: flang version ! VERSION-NEXT: Target: ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang-new: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/escaped-backslash.f90 b/flang/test/Driver/escaped-backslash.f90 index ad07eae24e9fab..90dd1783dd1150 100644 --- a/flang/test/Driver/escaped-backslash.f90 +++ b/flang/test/Driver/escaped-backslash.f90 @@ -1,14 +1,14 @@ ! Ensure argument -fbackslash works as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED diff --git a/flang/test/Driver/fdefault.f90 b/flang/test/Driver/fdefault.f90 index 88592bfa3e87ee..7ce45b763a240f 100644 --- a/flang/test/Driver/fdefault.f90 +++ b/flang/test/Driver/fdefault.f90 @@ -2,25 +2,25 @@ ! TODO: Add checks when actual codegen is possible for this family !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOOPTION -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=REAL8 -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOOPTION +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=REAL8 +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -fdefault-real-8 -fdefault-double-8 -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! NOOPTION: integer(4),parameter::real_kind=4_4 diff --git a/flang/test/Driver/flarge-sizes.f90 b/flang/test/Driver/flarge-sizes.f90 index 6ea5876676ed1f..6c41a03a830bfb 100644 --- a/flang/test/Driver/flarge-sizes.f90 +++ b/flang/test/Driver/flarge-sizes.f90 @@ -2,20 +2,20 @@ ! TODO: Add checks when actual codegen is possible. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=NOLARGE -! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 -! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=NOLARGE +! RUN: rm -rf %t/dir-flang && mkdir -p %t/dir-flang && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang %s 2>&1 +! RUN: cat %t/dir-flang/m.mod | FileCheck %s --check-prefix=LARGE ! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 diff --git a/flang/test/Driver/frame-pointer-forwarding.f90 b/flang/test/Driver/frame-pointer-forwarding.f90 index 751494cc6a6017..9fcbd6e12f98b7 100644 --- a/flang/test/Driver/frame-pointer-forwarding.f90 +++ b/flang/test/Driver/frame-pointer-forwarding.f90 @@ -1,4 +1,4 @@ -! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend +! Test that flang forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend ! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE ! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf" diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 index 35adb47b56861e..0a56a1e3710d9d 100644 --- a/flang/test/Driver/frontend-forwarding.f90 +++ b/flang/test/Driver/frontend-forwarding.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards Flang frontend -! options to flang-new -fc1 as expected. +! Test that flang forwards Flang frontend +! options to flang -fc1 as expected. ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \ ! RUN: -finput-charset=utf-8 \ diff --git a/flang/test/Driver/hlfir-no-hlfir-error.f90 b/flang/test/Driver/hlfir-no-hlfir-error.f90 index 2410393b6cd9c1..59f8304db5c9ab 100644 --- a/flang/test/Driver/hlfir-no-hlfir-error.f90 +++ b/flang/test/Driver/hlfir-no-hlfir-error.f90 @@ -2,12 +2,12 @@ ! options cannot be both used. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -emit-llvm -flang-experimental-hlfir -flang-deprecated-no-hlfir %s 2>&1 | FileCheck %s diff --git a/flang/test/Driver/intrinsic-module-path.f90 b/flang/test/Driver/intrinsic-module-path.f90 index 5523ed37b724cd..15d19dd83d963f 100644 --- a/flang/test/Driver/intrinsic-module-path.f90 +++ b/flang/test/Driver/intrinsic-module-path.f90 @@ -4,7 +4,7 @@ ! default one, causing a CHECKSUM error. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/large-data-threshold.f90 b/flang/test/Driver/large-data-threshold.f90 index 320566c4b2e43a..6a7eef79559d0b 100644 --- a/flang/test/Driver/large-data-threshold.f90 +++ b/flang/test/Driver/large-data-threshold.f90 @@ -7,11 +7,11 @@ ! RUN: not %flang -### -c --target=aarch64 -mcmodel=small -mlarge-data-threshold=32768 %s 2>&1 | FileCheck %s --check-prefix=NOT-SUPPORTED -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-mlarge-data-threshold=32768" -! CHECK-59000: "{{.*}}flang-new" "-fc1" +! CHECK-59000: "{{.*}}flang" "-fc1" ! CHECK-59000-SAME: "-mlarge-data-threshold=59000" -! CHECK-1M: "{{.*}}flang-new" "-fc1" +! CHECK-1M: "{{.*}}flang" "-fc1" ! CHECK-1M-SAME: "-mlarge-data-threshold=1048576" ! NO-MCMODEL: 'mlarge-data-threshold=' only applies to medium and large code models ! INVALID: error: invalid value 'nonsense' in '-mlarge-data-threshold=' diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index a51febc7009691..bad3d972e6bd6b 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang-new: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/macro-def-undef.F90 b/flang/test/Driver/macro-def-undef.F90 index 1332c6d6c02708..b13a9040833dbf 100644 --- a/flang/test/Driver/macro-def-undef.F90 +++ b/flang/test/Driver/macro-def-undef.F90 @@ -1,14 +1,14 @@ ! Ensure arguments -D and -U work as expected. !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 236325e3578f1d..51d37a718c542f 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -1,26 +1,26 @@ ! Test the behaviour of the driver when input is missing or is invalid. Note -! that with the compiler driver (flang-new), the input _has_ to be specified. +! that with the compiler driver (flang), the input _has_ to be specified. ! Indeed, the driver decides what "job/command" to create based on the input ! file's extension. No input file means that it doesn't know what to do -! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply +! (compile? preprocess? link?). The frontend driver (flang -fc1) simply ! assumes that "no explicit input == read from stdin" !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE ! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE !----------------------------------------- -! FLANG FRONTEND DRIVER (flang-new -fc1) +! FLANG FRONTEND DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang-new: error: no input files +! FLANG-NO-FILE: flang: error: no input files -! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang-new: error: no input files +! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 6c86f23f2b21fa..64ec8679abf94f 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang-new: error: cannot specify -o when generating multiple output files +! ERROR: flang: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index b0b94ab1386a74..7c51656f0001af 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -1,6 +1,6 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected. Assumes a gfx90a, aarch64, ! and sm_70 architecture, but doesn't require one to be ! installed or compiled for, just testing the appropriate ! generation of jobs are created with the correct @@ -8,8 +8,8 @@ ! Test regular -fopenmp with no offload ! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s -! CHECK-OPENMP: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" -! CHECK-OPENMP-NOT: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90" +! CHECK-OPENMP-NOT: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Test regular -fopenmp with offload, and invocation filtering options ! RUN: %flang -S -### %s -o %t 2>&1 \ @@ -22,47 +22,47 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST -! OFFLOAD-HOST: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-HOST-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-HOST-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! RUN: %flang -S -### %s 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE -! OFFLOAD-DEVICE: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" -! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "nvptx64-nvidia-cuda" -! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "nvptx64-nvidia-cuda" +! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp ! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s -! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" +! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90" ! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS -! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" ! OPENMP-OFFLOAD-ARGS-SAME: {{.*}}.f90" ! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp" -! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! OPENMP-OFFLOAD-ARGS-SAME: "-fopenmp" ! OPENMP-OFFLOAD-ARGS-SAME: "-fembed-offload-object={{.*}}.out" {{.*}}.bc" @@ -77,7 +77,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-threads-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS -! CHECK-THREADS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" +! CHECK-THREADS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -89,7 +89,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-teams-oversubscription \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS -! CHECK-TEAMS-OVS: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" +! CHECK-TEAMS-OVS: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -101,7 +101,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-nested-parallelism \ ! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR -! CHECK-NEST-PAR: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" +! CHECK-NEST-PAR: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -113,7 +113,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE -! CHECK-THREAD-STATE: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" +! CHECK-THREAD-STATE: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -125,7 +125,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" +! CHECK-TARGET-DEBUG: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90" ! RUN: %flang -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -137,7 +137,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-target-debug \ ! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG -! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" +! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90" ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp --offload-arch=gfx90a \ @@ -153,7 +153,7 @@ ! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \ ! RUN: -fopenmp-assume-no-thread-state \ ! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL -! CHECK-RTL-ALL: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" +! CHECK-RTL-ALL: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription" ! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism" ! CHECK-RTL-ALL: {{.*}}.f90" @@ -167,7 +167,7 @@ ! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \ ! RUN: -fopenmp-version=45 \ ! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION -! CHECK-OPENMP-VERSION: "{{[^"]*}}flang-new" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" +! CHECK-OPENMP-VERSION: "{{[^"]*}}flang" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90" ! Test diagnostic error when host IR file is non-existent ! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \ @@ -187,7 +187,7 @@ ! RUN: --target=aarch64-unknown-linux-gnu \ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-NO-OFFLOAD -! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-NO-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-NO-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! Test -fopenmp-force-usm option with offload @@ -196,16 +196,16 @@ ! RUN: --target=aarch64-unknown-linux-gnu -nogpulib\ ! RUN: | FileCheck %s --check-prefix=FORCE-USM-OFFLOAD -! FORCE-USM-OFFLOAD: "{{[^"]*}}flang-new" "-fc1" "-triple" "aarch64-unknown-linux-gnu" +! FORCE-USM-OFFLOAD: "{{[^"]*}}flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" -! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm" ! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \ ! RUN: --offload-arch=gfx900 \ ! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ ! RUN: | FileCheck --check-prefix=MLINK-BUILTIN-BITCODE %s -! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! MLINK-BUILTIN-BITCODE: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! MLINK-BUILTIN-BITCODE-SAME: "-mlink-builtin-bitcode" {{.*Inputs.*rocm.*amdgcn.*bitcode.*}}oclc_isa_version_900.bc ! Test that the -fopenmp-targets option is added to host compilation invocations @@ -219,9 +219,9 @@ ! RUN: --target=x86_64-unknown-linux-gnu -nogpulib \ ! RUN: | FileCheck %s --check-prefix=OFFLOAD-TARGETS -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" -! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple" "amdgcn-amd-amdhsa" +! OFFLOAD-TARGETS-NEXT: "{{[^"]*}}flang" "-fc1" "-triple" "amdgcn-amd-amdhsa" ! OFFLOAD-TARGETS-NOT: -fopenmp-targets -! OFFLOAD-TARGETS: "{{[^"]*}}flang-new" "-fc1" "-triple" "x86_64-unknown-linux-gnu" +! OFFLOAD-TARGETS: "{{[^"]*}}flang" "-fc1" "-triple" "x86_64-unknown-linux-gnu" ! OFFLOAD-TARGETS-SAME: "-fopenmp-targets=amdgcn-amd-amdhsa" diff --git a/flang/test/Driver/predefined-macros-compiler-version.F90 b/flang/test/Driver/predefined-macros-compiler-version.F90 index 823a730f96845a..f6924479281562 100644 --- a/flang/test/Driver/predefined-macros-compiler-version.F90 +++ b/flang/test/Driver/predefined-macros-compiler-version.F90 @@ -1,12 +1,12 @@ ! Check that the driver correctly defines macros with the compiler version !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case diff --git a/flang/test/Driver/std2018-wrong.f90 b/flang/test/Driver/std2018-wrong.f90 index 27ccc76bd39aad..93ba153d75f7f9 100644 --- a/flang/test/Driver/std2018-wrong.f90 +++ b/flang/test/Driver/std2018-wrong.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG diff --git a/flang/test/Driver/std2018.f90 b/flang/test/Driver/std2018.f90 index cf461cf89e4e19..1727f92127b711 100644 --- a/flang/test/Driver/std2018.f90 +++ b/flang/test/Driver/std2018.f90 @@ -1,7 +1,7 @@ ! Ensure argument -std=f2018 works as expected. !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN diff --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03 index 6e03f9f43fc602..1d850305cd040e 100644 --- a/flang/test/Driver/supported-suffices/f03-suffix.f03 +++ b/flang/test/Driver/supported-suffices/f03-suffix.f03 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f03 end program f03 diff --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08 index d5bcf4ce1de1cc..2b31e4c21876ae 100644 --- a/flang/test/Driver/supported-suffices/f08-suffix.f08 +++ b/flang/test/Driver/supported-suffices/f08-suffix.f08 @@ -1,5 +1,5 @@ ! RUN: %flang -### %s 2>&1 | FileCheck %s -! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o" +! CHECK: "{{.*}}flang" "-fc1" {{.*}} "-o" "{{.*}}.o" program f08 end program f08 diff --git a/flang/test/Driver/use-module-error.f90 b/flang/test/Driver/use-module-error.f90 index 0b47b682d938c0..bb37f0275701b8 100644 --- a/flang/test/Driver/use-module-error.f90 +++ b/flang/test/Driver/use-module-error.f90 @@ -1,7 +1,7 @@ ! Ensure that multiple module directories are not allowed !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -J %S/Inputs/ %s 2>&1 | FileCheck %s --allow-empty --check-prefix=SINGLEINCLUDE ! RUN: %flang -fsyntax-only -J %S/Inputs/ -J %S/Inputs/ %s 2>&1 | FileCheck %s --allow-empty --check-prefix=SINGLEINCLUDE @@ -13,7 +13,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -J %S/Inputs/ %s 2>&1 | FileCheck %s --allow-empty --check-prefix=SINGLEINCLUDE ! RUN: %flang_fc1 -fsyntax-only -J %S/Inputs/ -J %S/Inputs/ %s 2>&1 | FileCheck %s --allow-empty --check-prefix=SINGLEINCLUDE diff --git a/flang/test/Driver/use-module.f90 b/flang/test/Driver/use-module.f90 index 775c0424715883..2c3a38043fe16e 100644 --- a/flang/test/Driver/use-module.f90 +++ b/flang/test/Driver/use-module.f90 @@ -1,7 +1,7 @@ ! Checks that module search directories specified with `-J/-module-dir` and `-I` are handled correctly !-------------------------- -! FLANG DRIVER (flang-new) +! FLANG DRIVER (flang) !-------------------------- ! RUN: %flang -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty @@ -16,7 +16,7 @@ ! RUN: not %flang -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE !----------------------------------------- -! FRONTEND FLANG DRIVER (flang-new -fc1) +! FRONTEND FLANG DRIVER (flang -fc1) !----------------------------------------- ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -I %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=INCLUDED --allow-empty diff --git a/flang/test/Driver/version-loops.f90 b/flang/test/Driver/version-loops.f90 index b0fa01d572512a..d206393a04f486 100644 --- a/flang/test/Driver/version-loops.f90 +++ b/flang/test/Driver/version-loops.f90 @@ -1,5 +1,5 @@ -! Test that flang-new forwards the -f{no-,}version-loops-for-stride -! options correctly to flang-new -fc1 for different variants of optimisation +! Test that flang forwards the -f{no-,}version-loops-for-stride +! options correctly to flang -fc1 for different variants of optimisation ! and explicit flags. ! RUN: %flang -### %s -o %t 2>&1 -O3 \ @@ -23,32 +23,32 @@ ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \ ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no -! CHECK: "{{.*}}flang-new" "-fc1" +! CHECK: "{{.*}}flang" "-fc1" ! CHECK-SAME: "-fversion-loops-for-stride" ! CHECK-SAME: "-O3" -! CHECK-O2: "{{.*}}flang-new" "-fc1" +! CHECK-O2: "{{.*}}flang" "-fc1" ! CHECK-O2-NOT: "-fversion-loops-for-stride" ! CHECK-O2-SAME: "-O2" -! CHECK-O2-with: "{{.*}}flang-new" "-fc1" +! CHECK-O2-with: "{{.*}}flang" "-fc1" ! CHECK-O2-with-SAME: "-fversion-loops-for-stride" ! CHECK-O2-with-SAME: "-O2" -! CHECK-O4: "{{.*}}flang-new" "-fc1" +! CHECK-O4: "{{.*}}flang" "-fc1" ! CHECK-O4-SAME: "-fversion-loops-for-stride" ! CHECK-O4-SAME: "-O3" -! CHECK-Ofast: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast: "{{.*}}flang" "-fc1" ! CHECK-Ofast-SAME: "-ffast-math" ! CHECK-Ofast-SAME: "-fversion-loops-for-stride" ! CHECK-Ofast-SAME: "-O3" -! CHECK-Ofast-no: "{{.*}}flang-new" "-fc1" +! CHECK-Ofast-no: "{{.*}}flang" "-fc1" ! CHECK-Ofast-no-SAME: "-ffast-math" ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride" ! CHECK-Ofast-no-SAME: "-O3" -! CHECK-O3-no: "{{.*}}flang-new" "-fc1" +! CHECK-O3-no: "{{.*}}flang" "-fc1" ! CHECK-O3-no-NOT: "-fversion-loops-for-stride" ! CHECK-O3-no-SAME: "-O3" diff --git a/flang/test/Driver/wextra-ok.f90 b/flang/test/Driver/wextra-ok.f90 index 6a38d9481a36b7..441029aa0af276 100644 --- a/flang/test/Driver/wextra-ok.f90 +++ b/flang/test/Driver/wextra-ok.f90 @@ -1,4 +1,4 @@ -! Ensure that supplying -Wextra into flang-new does not raise error +! Ensure that supplying -Wextra into flang does not raise error ! The first check should be changed if -Wextra is implemented ! RUN: %flang -std=f2018 -Wextra %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-OK diff --git a/flang/test/HLFIR/hlfir-flags.f90 b/flang/test/HLFIR/hlfir-flags.f90 index b383a79d12c27b..0b1e80b1e3f636 100644 --- a/flang/test/HLFIR/hlfir-flags.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,4 +1,4 @@ -! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang-new), and +! Test -flang-deprecated-hlfir, -flang-experimental-hlfir (flang), and ! -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s diff --git a/flang/test/Lower/Intrinsics/command_argument_count.f90 b/flang/test/Lower/Intrinsics/command_argument_count.f90 index 0cf92d4444db98..a30b27d664fc0c 100644 --- a/flang/test/Lower/Intrinsics/command_argument_count.f90 +++ b/flang/test/Lower/Intrinsics/command_argument_count.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver -! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s +! bbc doesn't have a way to set the default kinds so we use flang driver +! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s ! CHECK-LABEL: argument_count_test subroutine argument_count_test() diff --git a/flang/test/Lower/Intrinsics/exit.f90 b/flang/test/Lower/Intrinsics/exit.f90 index c3110fcbec2b5a..bd551f7318a84a 100644 --- a/flang/test/Lower/Intrinsics/exit.f90 +++ b/flang/test/Lower/Intrinsics/exit.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s -! bbc doesn't have a way to set the default kinds so we use flang-new driver +! bbc doesn't have a way to set the default kinds so we use flang driver ! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s ! CHECK-LABEL: func @_QPexit_test1() { diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 index f9ab01881d250d..9b864c9a9849c3 100644 --- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 +++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: ieee_is_normal_f16 subroutine ieee_is_normal_f16(r) diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90 index 700b2d1a67c656..62b98c8ea98bee 100644 --- a/flang/test/Lower/Intrinsics/isnan.f90 +++ b/flang/test/Lower/Intrinsics/isnan.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s +! RUN: flang -fc1 -emit-fir %s -o - | FileCheck %s ! CHECK-LABEL: isnan_f32 subroutine isnan_f32(r) diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90 index ac18e59033a6b6..781ef8296a2b7d 100644 --- a/flang/test/Lower/Intrinsics/modulo.f90 +++ b/flang/test/Lower/Intrinsics/modulo.f90 @@ -1,5 +1,5 @@ ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL -! RUN: flang-new -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL +! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL ! ALL-LABEL: func @_QPmodulo_testr( ! ALL-SAME: %[[arg0:.*]]: !fir.ref{{.*}}, %[[arg1:.*]]: !fir.ref{{.*}}, %[[arg2:.*]]: !fir.ref{{.*}}) { diff --git a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 index f02884e5e92f38..425ccbc5dd56c5 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP allocate Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s program main integer :: x, y diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 index 3be61a1700ced3..7a7d28db8d6f5a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare reduction Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine declare_red() integer :: my_var diff --git a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 index c6a0a8f2cd0d22..be1ac2db5dfa4a 100644 --- a/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 +++ b/flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90 @@ -1,6 +1,6 @@ ! This test checks lowering of OpenMP declare simd Directive. -// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s +// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s subroutine sub(x, y) real, intent(inout) :: x, y diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 index 62bc247a1456a1..bc5baf4e1cf604 100644 --- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 +++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 @@ -1,7 +1,7 @@ ! This test checks lowering of `LASTPRIVATE` clause for scalar types. ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s !CHECK: func @_QPlastprivate_character(%[[ARG1:.*]]: !fir.boxchar<1>{{.*}}) { !CHECK-DAG: %[[ARG1_UNBOX:.*]]:2 = fir.unboxchar diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 index 32caac39778dee..99c521406a7775 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction-byref.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -mmlir --force-byref-reduction -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(byref @add_reduction_byref_i32 diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 index fdedbb06160761..cfeb5de83f4e82 100644 --- a/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 +++ b/flang/test/Lower/OpenMP/parallel-wsloop-reduction.f90 @@ -1,7 +1,7 @@ ! Check that for parallel do, reduction is only processed for the loop ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s -! RUN: flang-new -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s +! RUN: flang -fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s ! CHECK: omp.parallel { ! CHECK: omp.wsloop reduction(@add_reduction_i32 diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 4acbc0606d1977..f43234fb125b7e 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -132,13 +132,13 @@ tools = [ ToolSubst( "%flang", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=isysroot_flag, unresolved="fatal", ), ToolSubst( "%flang_fc1", - command=FindTool("flang-new"), + command=FindTool("flang"), extra_args=["-fc1"], unresolved="fatal", ), diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 9d7b8633958cb7..4362fcf0537616 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set(module_objects "") # Create module files directly from the top-level module source directory. -# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was +# If CMAKE_CROSSCOMPILING, then the newly built flang executable was # cross compiled, and thus can't be executed on the build system and thus # can't be used for generating module files. if (NOT CMAKE_CROSSCOMPILING) @@ -115,9 +115,9 @@ if (NOT CMAKE_CROSSCOMPILING) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${FLANG_SOURCE_DIR}/module/${filename}.f90 - DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) list(APPEND MODULE_FILES ${base}.mod) install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") @@ -142,9 +142,9 @@ if (NOT CMAKE_CROSSCOMPILING) set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib) add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} - COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} + COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 - DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} + DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends} ) add_custom_command(OUTPUT ${base}.f18.mod DEPENDS ${base}.mod diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 9f33cdfe3fa90f..615c673374faf4 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS TargetParser ) -add_flang_tool(flang-new +add_flang_tool(flang driver.cpp fc1_main.cpp ) -target_link_libraries(flang-new +target_link_libraries(flang PRIVATE flangFrontend flangFrontendTool ) -clang_target_link_libraries(flang-new +clang_target_link_libraries(flang PRIVATE clangDriver clangBasic @@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) -# Enable support for plugins, which need access to symbols from flang-new +# Enable support for plugins, which need access to symbols from flang if(FLANG_PLUGIN_SUPPORT) - export_executable_symbols_for_plugins(flang-new) + export_executable_symbols_for_plugins(flang) endif() -install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 52136df10c0b02..603aab4205836c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -95,7 +95,7 @@ int main(int argc, const char **argv) { llvm::StringSaver saver(a); ExpandResponseFiles(saver, args); - // Check if flang-new is in the frontend mode + // Check if flang is in the frontend mode auto firstArg = std::find_if(args.begin() + 1, args.end(), [](const char *a) { return a != nullptr; }); if (firstArg != args.end()) { @@ -104,7 +104,7 @@ int main(int argc, const char **argv) { << "Valid tools include '-fc1'.\n"; return 1; } - // Call flang-new frontend + // Call flang frontend if (llvm::StringRef(args[1]).starts_with("-fc1")) { return executeFC1Tool(args); } @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { // Set the environment variable, FLANG_COMPILER_OPTIONS_STRING, to contain all // the compiler options. This is intended for the frontend driver, - // flang-new -fc1, to enable the implementation of the COMPILER_OPTIONS + // flang -fc1, to enable the implementation of the COMPILER_OPTIONS // intrinsic. To this end, the frontend driver requires the list of the // original compiler options, which is not available through other means. // TODO: This way of passing information between the compiler and frontend diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index d948b7eb39b39c..9da1f926817a8b 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -504,15 +504,15 @@ if(build_runtimes) if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES) if (${LLVM_TOOL_FLANG_BUILD}) - message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new") - set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new") + message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang") + set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang") set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang") # TODO: This is a workaround until flang becomes a first-class project - # in llvm/CMakeList.txt. Until then, this line ensures that flang-new is - # built before "openmp" is built as a runtime project. Besides "flang-new" + # in llvm/CMakeList.txt. Until then, this line ensures that flang is + # built before "openmp" is built as a runtime project. Besides "flang" # to build the compiler, we also need to add "module_files" to make sure # that all .mod files are also properly build. - list(APPEND extra_deps "flang-new" "module_files") + list(APPEND extra_deps "flang" "module_files") endif() foreach(dep opt llvm-link llvm-extract clang clang-offload-packager) if(TARGET ${dep}) diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 9ffe8f56b76e67..9b771d1116ee38 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -89,9 +89,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 3b4259dfa380e8..c206386fa6b614 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -69,9 +69,9 @@ else() # Check for flang if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang) else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang.exe) endif() # Set fortran test compiler if flang is found >From fdd11969f56f8ec81bfd5ee5a06e991840291747 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 26 Sep 2024 10:39:53 -0500 Subject: [PATCH 2/7] [flang][driver] restore flang-new as symlink Restore flang-new as a symlink to flang for backwards compatibility Co-authored-by: H. Vetinari Co-authored-by: Andrzej Warzynski --- clang/lib/Driver/ToolChain.cpp | 3 +++ flang/tools/flang-driver/CMakeLists.txt | 4 ++++ flang/tools/flang-driver/driver.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index de250322b3b34d..4df31770950858 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -386,6 +386,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { {"cl", "--driver-mode=cl"}, {"++", "--driver-mode=g++"}, {"flang", "--driver-mode=flang"}, + // For backwards compatibility, we create a symlink for `flang` called + // `flang-new`. This will be removed in the future. + {"flang-new", "--driver-mode=flang"}, {"clang-dxc", "--driver-mode=dxc"}, }; diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 615c673374faf4..063acdd7dfe57c 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -36,3 +36,7 @@ if(FLANG_PLUGIN_SUPPORT) endif() install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}") + +# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang" +# is a widely adopted name. +add_flang_symlink(flang-new flang) diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 603aab4205836c..ed52988feaa59c 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -88,7 +88,8 @@ int main(int argc, const char **argv) { llvm::InitLLVM x(argc, argv); llvm::SmallVector args(argv, argv + argc); - clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang"); + clang::driver::ParsedClangName targetandMode = + clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]); std::string driverPath = getExecutablePath(args[0]); llvm::BumpPtrAllocator a; >From 48d19d7c43591268e4ce434c3c2a28b588c9fe95 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 30 Sep 2024 10:16:59 -0500 Subject: [PATCH 3/7] [flang][driver] add version to flang executable --- flang/tools/flang-driver/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt index 063acdd7dfe57c..9a89a6185a3291 100644 --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -28,6 +28,12 @@ clang_target_link_libraries(flang clangBasic ) +# This creates the executable with a version appended +# and creates a symlink to it without the version +if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows + set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION}) +endif() + option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON) # Enable support for plugins, which need access to symbols from flang >From 39fb4c728ab876148725e35fc02887702433eb65 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 3 Oct 2024 14:12:35 -0700 Subject: [PATCH 4/7] [flang][driver] add warning when using openmp --- clang/include/clang/Basic/DiagnosticDriverKinds.td | 3 +++ clang/include/clang/Basic/DiagnosticGroups.td | 4 ++++ clang/lib/Driver/ToolChains/Flang.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 97573fcf20c1fb..68722ad9633120 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning< def warn_drv_unsupported_openmp_library : Warning< "the library '%0=%1' is not supported, OpenMP will not be enabled">, InGroup; +def warn_openmp_experimental : Warning< + "OpenMP support in flang is still experimental">, + InGroup; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 41e719d4d57816..8273701e7b0963 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1583,3 +1583,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">; // Warnings about using the non-standard extension having an explicit specialization // with a storage class specifier. def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">; + +// A warning for options that enable a feature that is not yet complete +def ExperimentalOption : DiagGroup<"experimental-option">; + diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 1ca12ff81389a3..19b43594b00815 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is experimental. + D.Diag(diag::warn_openmp_experimental); // FIXME: Clang supports a whole bunch more flags here. break; >From c4f8e707de3f7c62ae323dfe821c5a3e075a27f7 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 06:27:05 -0700 Subject: [PATCH 5/7] [flang][doc] update note about CMake support --- flang/docs/FlangDriver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 47cf078cf2d0d4..23cbab30ee903e 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -335,7 +335,7 @@ just added using your new frontend option. ## CMake Support As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) -(and soon to be released CMake 3.24.0), `cmake` can detect `flang` as a +(CMake 3.28.0), `cmake` can detect `flang` as a supported Fortran compiler. You can configure your CMake projects to use `flang` as follows: ```bash >From 12c46452ac837d4bc3c592f635aff68e83545252 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 07:11:16 -0700 Subject: [PATCH 6/7] [flang][test] fix tests broken by rename --- flang/test/Driver/driver-version.f90 | 2 +- flang/test/Driver/lto-flags.f90 | 2 +- flang/test/Driver/missing-input.f90 | 6 +++--- flang/test/Driver/multiple-input-files.f90 | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flang/test/Driver/driver-version.f90 b/flang/test/Driver/driver-version.f90 index 4c6aecb1c4fa7e..6daeb0e767c0e0 100644 --- a/flang/test/Driver/driver-version.f90 +++ b/flang/test/Driver/driver-version.f90 @@ -9,7 +9,7 @@ ! VERSION-NEXT: Thread model: ! VERSION-NEXT: InstalledDir: -! ERROR: flang: error: unknown argument '--versions'; did you mean '--version'? +! ERROR: flang{{.*}}: error: unknown argument '--versions'; did you mean '--version'? ! VERSION-FC1: LLVM version diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90 index bad3d972e6bd6b..be9416810716a9 100644 --- a/flang/test/Driver/lto-flags.f90 +++ b/flang/test/Driver/lto-flags.f90 @@ -30,7 +30,7 @@ ! FULL-LTO: "-fc1" ! FULL-LTO-SAME: "-flto=full" -! THIN-LTO-ALL: flang: warning: the option '-flto=thin' is a work in progress +! THIN-LTO-ALL: flang{{.*}}: warning: the option '-flto=thin' is a work in progress ! THIN-LTO-ALL: "-fc1" ! THIN-LTO-ALL-SAME: "-flto=thin" ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto" diff --git a/flang/test/Driver/missing-input.f90 b/flang/test/Driver/missing-input.f90 index 51d37a718c542f..aeefbe14c20563 100644 --- a/flang/test/Driver/missing-input.f90 +++ b/flang/test/Driver/missing-input.f90 @@ -17,10 +17,10 @@ ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR -! FLANG-NO-FILE: flang: error: no input files +! FLANG-NO-FILE: flang{{.*}}: error: no input files -! FLANG-NONEXISTENT-FILE: flang: error: no such file or directory: {{.*}} -! FLANG-NONEXISTENT-FILE: flang: error: no input files +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no such file or directory: {{.*}} +! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no input files ! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist ! FLANG-FC1-DIR: error: {{.*}} is not a regular file diff --git a/flang/test/Driver/multiple-input-files.f90 b/flang/test/Driver/multiple-input-files.f90 index 64ec8679abf94f..0242db288babf2 100644 --- a/flang/test/Driver/multiple-input-files.f90 +++ b/flang/test/Driver/multiple-input-files.f90 @@ -39,7 +39,7 @@ ! FLANG-NEXT:end program hello ! TEST 2: `-o` does not when multiple input files are present -! ERROR: flang: error: cannot specify -o when generating multiple output files +! ERROR: flang{{.*}}: error: cannot specify -o when generating multiple output files ! TEST 3: The output file _was not_ specified - `flang_fc1` will process all ! input files and generate one output file for every input file. >From f2e919b65e9a8b833fd8a028a8c80c8c7439785c Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Fri, 4 Oct 2024 07:56:02 -0700 Subject: [PATCH 7/7] [flang][test] add check for OpenMP experimental warning --- flang/test/Driver/fopenmp.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flang/test/Driver/fopenmp.f90 b/flang/test/Driver/fopenmp.f90 index 9b4dc5ffb1f690..b3c3547800bdba 100644 --- a/flang/test/Driver/fopenmp.f90 +++ b/flang/test/Driver/fopenmp.f90 @@ -73,3 +73,7 @@ ! ! CHECK-LD-ANYMD: "{{.*}}ld{{(.exe)?}}" ! CHECK-LD-ANYMD: "-l{{(omp|gomp|iomp5md)}}" +! +! RUN: %flang -fopenmp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-EXPERIMENTAL +! +! CHECK-EXPERIMENTAL: flang{{.*}}: warning: OpenMP support in flang is still experimental From openmp-commits at lists.llvm.org Wed Oct 9 19:49:03 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Wed, 09 Oct 2024 19:49:03 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6707409f.050a0220.8500e.0637@mx.google.com> everythingfunctional wrote: @kiranchandramohan , I don't have commit access, so could you merge for me? https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 01:26:19 2024 From: openmp-commits at lists.llvm.org (Kiran Chandramohan via Openmp-commits) Date: Thu, 10 Oct 2024 01:26:19 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <67078fab.170a0220.21cde9.1cad@mx.google.com> https://github.com/kiranchandramohan closed https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 02:21:50 2024 From: openmp-commits at lists.llvm.org (LLVM Continuous Integration via Openmp-commits) Date: Thu, 10 Oct 2024 02:21:50 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <67079cae.050a0220.3489cb.18bc@mx.google.com> llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-fuzzer` running on `sanitizer-buildbot11` while building `.github,clang,flang,llvm,offload,openmp` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/159/builds/7879
Here is the relevant piece of the build log for the reference ``` Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure) (timed out) ... #6 0xacedca160438 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector>&) /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:910:5 #7 0xacedca14f828 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:915:6 #8 0xacedca178ec4 in main /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 #9 0xe71967a684c0 (/lib/aarch64-linux-gnu/libc.so.6+0x284c0) (BuildId: 32fa4d6f3a8d5f430bdb7af2eb779470cd5ec7c2) #10 0xe71967a68594 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x28594) (BuildId: 32fa4d6f3a8d5f430bdb7af2eb779470cd5ec7c2) #11 0xacedca143cac in _start (/home/b/sanitizer-aarch64-linux-fuzzer/build/RUNDIR-c-ares-CVE-2016-5180/c-ares-CVE-2016-5180-fsanitize_fuzzer+0xb3cac) SUMMARY: AddressSanitizer: heap-buffer-overflow ares_create_query.c in ares_create_query @@@BUILD_STEP test openssl-1.0.1f fuzzer@@@ Cloning into 'SRC'... command timed out: 1200 seconds without output running [b'python', b'../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'], attempting to kill process killed by signal 9 program finished with exit code -1 elapsedTime=2985.777262 Step 13 (test openssl-1.0.1f fuzzer) failure: test openssl-1.0.1f fuzzer (failure) @@@BUILD_STEP test openssl-1.0.1f fuzzer@@@ Cloning into 'SRC'... command timed out: 1200 seconds without output running [b'python', b'../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'], attempting to kill process killed by signal 9 program finished with exit code -1 elapsedTime=2985.777262 ```
https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 02:47:20 2024 From: openmp-commits at lists.llvm.org (LLVM Continuous Integration via Openmp-commits) Date: Thu, 10 Oct 2024 02:47:20 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6707a2a8.170a0220.1416fb.1891@mx.google.com> llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux` running on `sanitizer-buildbot2` while building `.github,clang,flang,llvm,offload,openmp` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/4738
Here is the relevant piece of the build log for the reference ``` Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure) ... [385/391] Generating FuzzerUtils-x86_64-Test [386/391] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o [387/391] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o [388/391] Generating Msan-x86_64-with-call-Test [389/391] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o [390/391] Generating Msan-x86_64-Test [390/391] Running compiler_rt regression tests llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds. -- Testing: 4686 of 10415 tests, 88 workers -- Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90. FAIL: libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test (4580 of 4686) ******************** TEST 'libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test' FAILED ******************** Exit Code: 1 Command Output (stderr): -- RUN: at line 3: rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C RUN: at line 4: mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C RUN: at line 5: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest + /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest RUN: at line 6: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest + /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest RUN: at line 7: /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test + /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test RUN: at line 11: /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT + /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test:12:8: error: COUNT: expected string not found in input COUNT: seed corpus: files: 4 ^ :1:1: note: scanning from here INFO: Running with entropic power schedule (0xFF, 100). ^ :7:7: note: possible intended match here INFO: seed corpus: files: 3 min: 2b max: 3b total: 7b rss: 31Mb ^ Input file: Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test -dump-input=help explains the following input dump. Input was: <<<<<< 1: INFO: Running with entropic power schedule (0xFF, 100). check:12'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure) ... [385/391] Generating FuzzerUtils-x86_64-Test [386/391] Generating MSAN_INST_GTEST.gtest-all.cc.x86_64.o [387/391] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64-with-call.o [388/391] Generating Msan-x86_64-with-call-Test [389/391] Generating MSAN_INST_TEST_OBJECTS.msan_test.cpp.x86_64.o [390/391] Generating Msan-x86_64-Test [390/391] Running compiler_rt regression tests llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds. -- Testing: 4686 of 10415 tests, 88 workers -- Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90. FAIL: libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test (4580 of 4686) ******************** TEST 'libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test' FAILED ******************** Exit Code: 1 Command Output (stderr): -- RUN: at line 3: rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C RUN: at line 4: mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C RUN: at line 5: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest + /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest RUN: at line 6: /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest + /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest RUN: at line 7: /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test + /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test RUN: at line 11: /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT + /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C + FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test:12:8: error: COUNT: expected string not found in input COUNT: seed corpus: files: 4 ^ :1:1: note: scanning from here INFO: Running with entropic power schedule (0xFF, 100). ^ :7:7: note: possible intended match here INFO: seed corpus: files: 3 min: 2b max: 3b total: 7b rss: 31Mb ^ Input file: Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test -dump-input=help explains the following input dump. Input was: <<<<<< 1: INFO: Running with entropic power schedule (0xFF, 100). check:12'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found ```
https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 03:35:40 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Thu, 10 Oct 2024 03:35:40 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6707adfc.170a0220.3ea1f.1f54@mx.google.com> h-vetinari wrote: Congratulations on this huge milestone to all involved in flang! 🍾 πŸ₯³ πŸš€ https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 05:53:11 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Thu, 10 Oct 2024 05:53:11 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6707ce37.170a0220.311702.240a@mx.google.com> RichBarton-Arm wrote: +1000 Great to see this finally happen. Great job everyone! https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 05:54:43 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Thu, 10 Oct 2024 05:54:43 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) Message-ID: https://github.com/nikic created https://github.com/llvm/llvm-project/pull/111831 On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809. >From fce625888fc87d6eb572e4cba39ef7cc72fef466 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Oct 2024 12:47:33 +0000 Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not available On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809. --- openmp/runtime/src/kmp_affinity.cpp | 93 ++++++++++++++------ openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index cf5cad04eb57d5..9074a00c0d9c4e 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf, return buf; } -// Return (possibly empty) affinity mask representing the offline CPUs -// Caller must free the mask -kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { - kmp_affin_mask_t *offline; - KMP_CPU_ALLOC(offline); - KMP_CPU_ZERO(offline); +static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) { + kmp_affin_mask_t *mask; + KMP_CPU_ALLOC(mask); + KMP_CPU_ZERO(mask); #if KMP_OS_LINUX int n, begin_cpu, end_cpu; - kmp_safe_raii_file_t offline_file; + kmp_safe_raii_file_t file; auto skip_ws = [](FILE *f) { int c; do { @@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { if (c != EOF) ungetc(c, f); }; - // File contains CSV of integer ranges representing the offline CPUs + // File contains CSV of integer ranges representing the CPUs // e.g., 1,2,4-7,9,11-15 - int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r"); + int status = file.try_open(path, "r"); if (status != 0) - return offline; - while (!feof(offline_file)) { - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &begin_cpu); + return mask; + while (!feof(file)) { + skip_ws(file); + n = fscanf(file, "%d", &begin_cpu); if (n != 1) break; - skip_ws(offline_file); - int c = fgetc(offline_file); + skip_ws(file); + int c = fgetc(file); if (c == EOF || c == ',') { // Just single CPU end_cpu = begin_cpu; } else if (c == '-') { // Range of CPUs - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &end_cpu); + skip_ws(file); + n = fscanf(file, "%d", &end_cpu); if (n != 1) break; - skip_ws(offline_file); - c = fgetc(offline_file); // skip ',' + skip_ws(file); + c = fgetc(file); // skip ',' } else { // Syntax problem break; @@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { end_cpu >= __kmp_xproc || begin_cpu > end_cpu) { continue; } - // Insert [begin_cpu, end_cpu] into offline mask + // Insert [begin_cpu, end_cpu] into mask for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) { - KMP_CPU_SET(cpu, offline); + KMP_CPU_SET(cpu, mask); } } #endif - return offline; + return mask; +} + +// Return (possibly empty) affinity mask representing the offline CPUs +// Caller must free the mask +kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline"); } // Return the number of available procs @@ -3175,6 +3179,30 @@ static inline const char *__kmp_cpuinfo_get_envvar() { return envvar; } +static bool __kmp_package_id_from_core_sibling_list(unsigned **threadInfo, + unsigned idx) { + char path[256]; + KMP_SNPRINTF( + path, sizeof(path), + "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", + threadInfo[idx][osIdIndex]); + kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); + for (unsigned i = 0; i < __kmp_xproc; ++i) { + if (!KMP_CPU_ISSET(i, siblings)) + continue; + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + // Arbitrarily pick the first index we encounter, it only matters that + // the value is the same for all siblings. + threadInfo[i][pkgIdIndex] = idx; + } else if (threadInfo[i][pkgIdIndex] != idx) { + // Contradictory sibling lists. + return false; + } + } + KMP_CPU_FREE(siblings); + return true; +} + // Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the // affinity map. On AIX, the map is obtained through system SRAD (Scheduler // Resource Allocation Domain). @@ -3550,18 +3578,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, return false; } - // Check for missing fields. The osId field must be there, and we - // currently require that the physical id field is specified, also. + // Check for missing fields. The osId field must be there. The physical + // id field will be checked later. if (threadInfo[num_avail][osIdIndex] == UINT_MAX) { CLEANUP_THREAD_INFO; *msg_id = kmp_i18n_str_MissingProcField; return false; } - if (threadInfo[0][pkgIdIndex] == UINT_MAX) { - CLEANUP_THREAD_INFO; - *msg_id = kmp_i18n_str_MissingPhysicalIDField; - return false; - } // Skip this proc if it is not included in the machine model. if (KMP_AFFINITY_CAPABLE() && @@ -3591,6 +3614,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, } *line = 0; + // At least on powerpc, Linux may return -1 for physical_package_id. Try + // to reconstruct topology from core_sibling_list in that case. + for (i = 0; i < num_avail; ++i) { + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + if (!__kmp_package_id_from_core_sibling_list(threadInfo, i)) { + CLEANUP_THREAD_INFO; + *msg_id = kmp_i18n_str_MissingPhysicalIDField; + return false; + } + } + } + #if KMP_MIC && REDUCE_TEAM_SIZE unsigned teamSize = 0; #endif // KMP_MIC && REDUCE_TEAM_SIZE diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c index 606fcdfbada95a..0b49969bd3b10c 100644 --- a/openmp/runtime/test/affinity/kmp-hw-subset.c +++ b/openmp/runtime/test/affinity/kmp-hw-subset.c @@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, expected_per_place = nthreads_per_core; } else { expected_total = nsockets; - expected_per_place = ncores_per_socket; + expected_per_place = ncores_per_socket * nthreads_per_core; } if (openmp_places->num_places != expected_total) { fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n"); From openmp-commits at lists.llvm.org Thu Oct 10 05:58:00 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Thu, 10 Oct 2024 05:58:00 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <6707cf58.050a0220.3a9dc1.2f59@mx.google.com> ================ @@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, expected_per_place = nthreads_per_core; } else { expected_total = nsockets; - expected_per_place = ncores_per_socket; + expected_per_place = ncores_per_socket * nthreads_per_core; ---------------- nikic wrote: Unless I'm misunderstanding something, the count should always be in terms of threads. I think maybe this test has been getting away with it, because on x86 the number of threads per core is at most 2, so after halving it it is always 1 and this multiplication does not matter. On the ppc system I'm testing the number of threads per core is 6, so after halving it's 3 and the test would fail if we don't multiply here. https://github.com/llvm/llvm-project/pull/111831 From openmp-commits at lists.llvm.org Thu Oct 10 06:00:59 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Thu, 10 Oct 2024 06:00:59 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <6707d00b.630a0220.81d98.267a@mx.google.com> github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning:
You can test this locally with the following command: ``````````bash git-clang-format --diff ced15cd418d96fc3d078e687bdcc5875656c71f6 fce625888fc87d6eb572e4cba39ef7cc72fef466 --extensions c,cpp -- openmp/runtime/src/kmp_affinity.cpp openmp/runtime/test/affinity/kmp-hw-subset.c ``````````
View the diff from clang-format here. ``````````diff diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index 9074a00c0d..099fe203e9 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -3182,10 +3182,9 @@ static inline const char *__kmp_cpuinfo_get_envvar() { static bool __kmp_package_id_from_core_sibling_list(unsigned **threadInfo, unsigned idx) { char path[256]; - KMP_SNPRINTF( - path, sizeof(path), - "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", - threadInfo[idx][osIdIndex]); + KMP_SNPRINTF(path, sizeof(path), + "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", + threadInfo[idx][osIdIndex]); kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); for (unsigned i = 0; i < __kmp_xproc; ++i) { if (!KMP_CPU_ISSET(i, siblings)) ``````````
https://github.com/llvm/llvm-project/pull/111831 From openmp-commits at lists.llvm.org Thu Oct 10 06:05:55 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Thu, 10 Oct 2024 06:05:55 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <6707d133.050a0220.aaf10.2cd7@mx.google.com> https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/111831 >From 261649d5aeff3f09150ac1fb67cb1d8c09899be2 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Oct 2024 12:47:33 +0000 Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not available On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809. --- openmp/runtime/src/kmp_affinity.cpp | 92 ++++++++++++++------ openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +- 2 files changed, 64 insertions(+), 30 deletions(-) diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index cf5cad04eb57d5..099fe203e97b4b 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf, return buf; } -// Return (possibly empty) affinity mask representing the offline CPUs -// Caller must free the mask -kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { - kmp_affin_mask_t *offline; - KMP_CPU_ALLOC(offline); - KMP_CPU_ZERO(offline); +static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) { + kmp_affin_mask_t *mask; + KMP_CPU_ALLOC(mask); + KMP_CPU_ZERO(mask); #if KMP_OS_LINUX int n, begin_cpu, end_cpu; - kmp_safe_raii_file_t offline_file; + kmp_safe_raii_file_t file; auto skip_ws = [](FILE *f) { int c; do { @@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { if (c != EOF) ungetc(c, f); }; - // File contains CSV of integer ranges representing the offline CPUs + // File contains CSV of integer ranges representing the CPUs // e.g., 1,2,4-7,9,11-15 - int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r"); + int status = file.try_open(path, "r"); if (status != 0) - return offline; - while (!feof(offline_file)) { - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &begin_cpu); + return mask; + while (!feof(file)) { + skip_ws(file); + n = fscanf(file, "%d", &begin_cpu); if (n != 1) break; - skip_ws(offline_file); - int c = fgetc(offline_file); + skip_ws(file); + int c = fgetc(file); if (c == EOF || c == ',') { // Just single CPU end_cpu = begin_cpu; } else if (c == '-') { // Range of CPUs - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &end_cpu); + skip_ws(file); + n = fscanf(file, "%d", &end_cpu); if (n != 1) break; - skip_ws(offline_file); - c = fgetc(offline_file); // skip ',' + skip_ws(file); + c = fgetc(file); // skip ',' } else { // Syntax problem break; @@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { end_cpu >= __kmp_xproc || begin_cpu > end_cpu) { continue; } - // Insert [begin_cpu, end_cpu] into offline mask + // Insert [begin_cpu, end_cpu] into mask for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) { - KMP_CPU_SET(cpu, offline); + KMP_CPU_SET(cpu, mask); } } #endif - return offline; + return mask; +} + +// Return (possibly empty) affinity mask representing the offline CPUs +// Caller must free the mask +kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline"); } // Return the number of available procs @@ -3175,6 +3179,29 @@ static inline const char *__kmp_cpuinfo_get_envvar() { return envvar; } +static bool __kmp_package_id_from_core_sibling_list(unsigned **threadInfo, + unsigned idx) { + char path[256]; + KMP_SNPRINTF(path, sizeof(path), + "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", + threadInfo[idx][osIdIndex]); + kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); + for (unsigned i = 0; i < __kmp_xproc; ++i) { + if (!KMP_CPU_ISSET(i, siblings)) + continue; + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + // Arbitrarily pick the first index we encounter, it only matters that + // the value is the same for all siblings. + threadInfo[i][pkgIdIndex] = idx; + } else if (threadInfo[i][pkgIdIndex] != idx) { + // Contradictory sibling lists. + return false; + } + } + KMP_CPU_FREE(siblings); + return true; +} + // Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the // affinity map. On AIX, the map is obtained through system SRAD (Scheduler // Resource Allocation Domain). @@ -3550,18 +3577,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, return false; } - // Check for missing fields. The osId field must be there, and we - // currently require that the physical id field is specified, also. + // Check for missing fields. The osId field must be there. The physical + // id field will be checked later. if (threadInfo[num_avail][osIdIndex] == UINT_MAX) { CLEANUP_THREAD_INFO; *msg_id = kmp_i18n_str_MissingProcField; return false; } - if (threadInfo[0][pkgIdIndex] == UINT_MAX) { - CLEANUP_THREAD_INFO; - *msg_id = kmp_i18n_str_MissingPhysicalIDField; - return false; - } // Skip this proc if it is not included in the machine model. if (KMP_AFFINITY_CAPABLE() && @@ -3591,6 +3613,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, } *line = 0; + // At least on powerpc, Linux may return -1 for physical_package_id. Try + // to reconstruct topology from core_sibling_list in that case. + for (i = 0; i < num_avail; ++i) { + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + if (!__kmp_package_id_from_core_sibling_list(threadInfo, i)) { + CLEANUP_THREAD_INFO; + *msg_id = kmp_i18n_str_MissingPhysicalIDField; + return false; + } + } + } + #if KMP_MIC && REDUCE_TEAM_SIZE unsigned teamSize = 0; #endif // KMP_MIC && REDUCE_TEAM_SIZE diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c index 606fcdfbada95a..0b49969bd3b10c 100644 --- a/openmp/runtime/test/affinity/kmp-hw-subset.c +++ b/openmp/runtime/test/affinity/kmp-hw-subset.c @@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, expected_per_place = nthreads_per_core; } else { expected_total = nsockets; - expected_per_place = ncores_per_socket; + expected_per_place = ncores_per_socket * nthreads_per_core; } if (openmp_places->num_places != expected_total) { fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n"); From openmp-commits at lists.llvm.org Thu Oct 10 06:17:32 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Thu, 10 Oct 2024 06:17:32 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <6707d3ec.170a0220.dbcb2.35ae@mx.google.com> https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/111831 >From c4cedb269c5dd82bb5d1c7a3cd24b74b1c8ea1f7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Oct 2024 12:47:33 +0000 Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not available On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809. --- openmp/runtime/src/kmp_affinity.cpp | 93 ++++++++++++++------ openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index cf5cad04eb57d5..d4de843812172f 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf, return buf; } -// Return (possibly empty) affinity mask representing the offline CPUs -// Caller must free the mask -kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { - kmp_affin_mask_t *offline; - KMP_CPU_ALLOC(offline); - KMP_CPU_ZERO(offline); +static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) { + kmp_affin_mask_t *mask; + KMP_CPU_ALLOC(mask); + KMP_CPU_ZERO(mask); #if KMP_OS_LINUX int n, begin_cpu, end_cpu; - kmp_safe_raii_file_t offline_file; + kmp_safe_raii_file_t file; auto skip_ws = [](FILE *f) { int c; do { @@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { if (c != EOF) ungetc(c, f); }; - // File contains CSV of integer ranges representing the offline CPUs + // File contains CSV of integer ranges representing the CPUs // e.g., 1,2,4-7,9,11-15 - int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r"); + int status = file.try_open(path, "r"); if (status != 0) - return offline; - while (!feof(offline_file)) { - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &begin_cpu); + return mask; + while (!feof(file)) { + skip_ws(file); + n = fscanf(file, "%d", &begin_cpu); if (n != 1) break; - skip_ws(offline_file); - int c = fgetc(offline_file); + skip_ws(file); + int c = fgetc(file); if (c == EOF || c == ',') { // Just single CPU end_cpu = begin_cpu; } else if (c == '-') { // Range of CPUs - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &end_cpu); + skip_ws(file); + n = fscanf(file, "%d", &end_cpu); if (n != 1) break; - skip_ws(offline_file); - c = fgetc(offline_file); // skip ',' + skip_ws(file); + c = fgetc(file); // skip ',' } else { // Syntax problem break; @@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { end_cpu >= __kmp_xproc || begin_cpu > end_cpu) { continue; } - // Insert [begin_cpu, end_cpu] into offline mask + // Insert [begin_cpu, end_cpu] into mask for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) { - KMP_CPU_SET(cpu, offline); + KMP_CPU_SET(cpu, mask); } } #endif - return offline; + return mask; +} + +// Return (possibly empty) affinity mask representing the offline CPUs +// Caller must free the mask +kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline"); } // Return the number of available procs @@ -3175,6 +3179,30 @@ static inline const char *__kmp_cpuinfo_get_envvar() { return envvar; } +static bool __kmp_package_id_from_core_sibling_list(unsigned **threadInfo, + unsigned idx) { + char path[256]; + KMP_SNPRINTF(path, sizeof(path), + "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", + threadInfo[idx][osIdIndex]); + kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); + for (unsigned i = 0; i < __kmp_xproc; ++i) { + if (!KMP_CPU_ISSET(i, siblings)) + continue; + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + // Arbitrarily pick the first index we encounter, it only matters that + // the value is the same for all siblings. + threadInfo[i][pkgIdIndex] = idx; + } else if (threadInfo[i][pkgIdIndex] != idx) { + // Contradictory sibling lists. + KMP_CPU_FREE(siblings); + return false; + } + } + KMP_CPU_FREE(siblings); + return true; +} + // Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the // affinity map. On AIX, the map is obtained through system SRAD (Scheduler // Resource Allocation Domain). @@ -3550,18 +3578,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, return false; } - // Check for missing fields. The osId field must be there, and we - // currently require that the physical id field is specified, also. + // Check for missing fields. The osId field must be there. The physical + // id field will be checked later. if (threadInfo[num_avail][osIdIndex] == UINT_MAX) { CLEANUP_THREAD_INFO; *msg_id = kmp_i18n_str_MissingProcField; return false; } - if (threadInfo[0][pkgIdIndex] == UINT_MAX) { - CLEANUP_THREAD_INFO; - *msg_id = kmp_i18n_str_MissingPhysicalIDField; - return false; - } // Skip this proc if it is not included in the machine model. if (KMP_AFFINITY_CAPABLE() && @@ -3591,6 +3614,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, } *line = 0; + // At least on powerpc, Linux may return -1 for physical_package_id. Try + // to reconstruct topology from core_sibling_list in that case. + for (i = 0; i < num_avail; ++i) { + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + if (!__kmp_package_id_from_core_sibling_list(threadInfo, i)) { + CLEANUP_THREAD_INFO; + *msg_id = kmp_i18n_str_MissingPhysicalIDField; + return false; + } + } + } + #if KMP_MIC && REDUCE_TEAM_SIZE unsigned teamSize = 0; #endif // KMP_MIC && REDUCE_TEAM_SIZE diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c index 606fcdfbada95a..0b49969bd3b10c 100644 --- a/openmp/runtime/test/affinity/kmp-hw-subset.c +++ b/openmp/runtime/test/affinity/kmp-hw-subset.c @@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, expected_per_place = nthreads_per_core; } else { expected_total = nsockets; - expected_per_place = ncores_per_socket; + expected_per_place = ncores_per_socket * nthreads_per_core; } if (openmp_places->num_places != expected_total) { fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n"); From openmp-commits at lists.llvm.org Thu Oct 10 11:01:19 2024 From: openmp-commits at lists.llvm.org (Peter Klausler via Openmp-commits) Date: Thu, 10 Oct 2024 11:01:19 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6708166f.170a0220.569b3.009c@mx.google.com> klausler wrote: There are multiple weird failures in llvm-test-suite where clang++ complains about unknown options that look like they're slang-only options. Did you run llvm-test-suite before merging? Please check. These failures are going to cause build bot failures shortly in the clang-*-2stage builds if not repaired or reverted. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:09:46 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Thu, 10 Oct 2024 11:09:46 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <6708186a.170a0220.122b03.5115@mx.google.com> everythingfunctional wrote: @klausler , can you point me specifically at the failure messages? The failures I've seen so far from the merge did not look related to my (admittedly untrained) eye. I ran the tests in the repo and they passed locally. Are there other tests somewhere that need to be updated as well? https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:11:11 2024 From: openmp-commits at lists.llvm.org (Peter Klausler via Openmp-commits) Date: Thu, 10 Oct 2024 11:11:11 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <670818bf.170a0220.17ab24.4ce6@mx.google.com> klausler wrote: > @klausler , can you point me specifically at the failure messages? The failures I've seen so far from the merge did not look related to my (admittedly untrained) eye. I ran the tests in the repo and they passed locally. Are there other tests somewhere that need to be updated as well? They haven't shown up in the build bots, so it must be something in my local environment that I've missed. If you ran llvm-test-suite's Fortran tests cleanly, then don't worry. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:15:12 2024 From: openmp-commits at lists.llvm.org (Kiran Chandramohan via Openmp-commits) Date: Thu, 10 Oct 2024 11:15:12 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <670819b0.170a0220.1918f7.4df3@mx.google.com> kiranchandramohan wrote: The 2 stage buildbot (https://lab.llvm.org/buildbot/#/builders/41) with the Fortran tests passed after this merge. Its latest run is also a pass. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:18:27 2024 From: openmp-commits at lists.llvm.org (Kiran Chandramohan via Openmp-commits) Date: Thu, 10 Oct 2024 11:18:27 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <67081a73.170a0220.a11fc.4d93@mx.google.com> kiranchandramohan wrote: @everythingfunctional Following are the steps to run the testsuite. Please check and confirm if you did not run it before. ``` git clone https://github.com/llvm/llvm-test-suite.git cd llvm-test-suite mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$HOME/llvm-project/build_release/bin/clang -DCMAKE_CXX_COMPILER=$HOME/llvm-project/build_release/bin/clang++ -DCMAKE_Fortran_COMPILER=$HOME/llvm-project/build_release/bin/flang-new -DTEST_SUITE_FORTRAN=On -DTEST_SUITE_SUBDIRS=Fortran -DTEST_SUITE_FORTRAN_ISO_C_HEADER_DIR=$HOME/llvm-project/flang/include/flang ../ make -j48 NO_STOP_MESSAGE=1 $HOME/llvm-project/build_release/bin/llvm-lit -v . ``` https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:49:12 2024 From: openmp-commits at lists.llvm.org (Brad Richardson via Openmp-commits) Date: Thu, 10 Oct 2024 11:49:12 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <670821a8.170a0220.26f3f9.05e8@mx.google.com> everythingfunctional wrote: > @everythingfunctional Following are the steps to run the testsuite. Please check and confirm if you did not run it before. > > ``` > git clone https://github.com/llvm/llvm-test-suite.git > cd llvm-test-suite > mkdir build > cd build > cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$HOME/llvm-project/build_release/bin/clang -DCMAKE_CXX_COMPILER=$HOME/llvm-project/build_release/bin/clang++ -DCMAKE_Fortran_COMPILER=$HOME/llvm-project/build_release/bin/flang-new -DTEST_SUITE_FORTRAN=On -DTEST_SUITE_SUBDIRS=Fortran -DTEST_SUITE_FORTRAN_ISO_C_HEADER_DIR=$HOME/llvm-project/flang/include/flang ../ > make -j48 > NO_STOP_MESSAGE=1 $HOME/llvm-project/build_release/bin/llvm-lit -v . > ``` Only failure I got was: ```text Failed Tests (1): test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__proc_ptr_1_f90.test ``` Which I don't think the rename is at fault for. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Thu Oct 10 11:51:29 2024 From: openmp-commits at lists.llvm.org (Peter Klausler via Openmp-commits) Date: Thu, 10 Oct 2024 11:51:29 -0700 (PDT) Subject: [Openmp-commits] [clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023) In-Reply-To: Message-ID: <67082231.050a0220.56e0.57ce@mx.google.com> klausler wrote: > Which I don't think the rename is at fault for. If you rebase to current llvm-project/main, that test will (or should) work; it got broken yesterday and was fixed later. https://github.com/llvm/llvm-project/pull/110023 From openmp-commits at lists.llvm.org Fri Oct 11 05:04:05 2024 From: openmp-commits at lists.llvm.org (Josep Pinot via Openmp-commits) Date: Fri, 11 Oct 2024 05:04:05 -0700 (PDT) Subject: [Openmp-commits] [openmp] [OpenMP] Fix missing gtid argument in __kmp_print_tdg_dot function (PR #111986) Message-ID: https://github.com/jpinot created https://github.com/llvm/llvm-project/pull/111986 This patch modifies the signature of the `__kmp_print_tdg_dot` function in `kmp_tasking.cpp` to include the global thread ID (gtid) as an argument. The gtid is now correctly passed to the function. - Updated the function declaration to accept the gtid parameter. - Modified all calls to `__kmp_print_tdg_dot` to pass the correct gtid value. This change addresses issues encountered when compiling with `OMPX_TASKGRAPH` enabled. No functional changes are expected beyond successful compilation. >From 6c6d334497bf01d2f72261092a0ee00409ce01b6 Mon Sep 17 00:00:00 2001 From: jpinot Date: Fri, 11 Oct 2024 13:47:46 +0200 Subject: [PATCH] [OpenMP] Fix missing input argument in __kmp_print_tdg_dot function Modified __kmp_print_tdg_dot to accept the global thread ID (gtid). Updated all calls to pass the gtid, ensuring correct task identification when printing the task dependency graph (TDG). --- openmp/runtime/src/kmp_tasking.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp index 7edaa8e127e52c..932799e133b45b 100644 --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -5491,7 +5491,8 @@ static kmp_tdg_info_t *__kmp_find_tdg(kmp_int32 tdg_id) { // __kmp_print_tdg_dot: prints the TDG to a dot file // tdg: ID of the TDG -void __kmp_print_tdg_dot(kmp_tdg_info_t *tdg) { +// gtid: Global Thread ID +void __kmp_print_tdg_dot(kmp_tdg_info_t *tdg, kmp_int32 gtid) { kmp_int32 tdg_id = tdg->tdg_id; KA_TRACE(10, ("__kmp_print_tdg_dot(enter): T#%d tdg_id=%d \n", gtid, tdg_id)); @@ -5693,7 +5694,7 @@ void __kmp_end_record(kmp_int32 gtid, kmp_tdg_info_t *tdg) { KMP_ATOMIC_ST_RLX(&__kmp_tdg_task_id, 0); if (__kmp_tdg_dot) - __kmp_print_tdg_dot(tdg); + __kmp_print_tdg_dot(tdg, gtid); } // __kmpc_end_record_task: wrapper around __kmp_end_record to mark From openmp-commits at lists.llvm.org Fri Oct 11 05:04:25 2024 From: openmp-commits at lists.llvm.org (via Openmp-commits) Date: Fri, 11 Oct 2024 05:04:25 -0700 (PDT) Subject: [Openmp-commits] [openmp] [OpenMP] Fix missing gtid argument in __kmp_print_tdg_dot function (PR #111986) In-Reply-To: Message-ID: <67091449.a70a0220.2c877a.8ba5@mx.google.com> github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using `@` followed by their GitHub username. If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment β€œPing”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the [LLVM GitHub User Guide](https://llvm.org/docs/GitHub.html). You can also ask questions in a comment on this PR, on the [LLVM Discord](https://discord.com/invite/xS7Z362) or on the [forums](https://discourse.llvm.org/). https://github.com/llvm/llvm-project/pull/111986 From openmp-commits at lists.llvm.org Fri Oct 11 09:41:25 2024 From: openmp-commits at lists.llvm.org (Nikita Popov via Openmp-commits) Date: Fri, 11 Oct 2024 09:41:25 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <67095535.050a0220.103e21.a0ec@mx.google.com> https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/111831 >From 5fb4d7f6079a76b2907ccc8c53c7c509c30a3dca Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Oct 2024 12:47:33 +0000 Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not available On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809. --- openmp/runtime/src/kmp_affinity.cpp | 100 +++++++++++++------ openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +- 2 files changed, 72 insertions(+), 30 deletions(-) diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index cf5cad04eb57d5..c3d5ecf1345e89 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf, return buf; } -// Return (possibly empty) affinity mask representing the offline CPUs -// Caller must free the mask -kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { - kmp_affin_mask_t *offline; - KMP_CPU_ALLOC(offline); - KMP_CPU_ZERO(offline); +static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) { + kmp_affin_mask_t *mask; + KMP_CPU_ALLOC(mask); + KMP_CPU_ZERO(mask); #if KMP_OS_LINUX int n, begin_cpu, end_cpu; - kmp_safe_raii_file_t offline_file; + kmp_safe_raii_file_t file; auto skip_ws = [](FILE *f) { int c; do { @@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { if (c != EOF) ungetc(c, f); }; - // File contains CSV of integer ranges representing the offline CPUs + // File contains CSV of integer ranges representing the CPUs // e.g., 1,2,4-7,9,11-15 - int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r"); + int status = file.try_open(path, "r"); if (status != 0) - return offline; - while (!feof(offline_file)) { - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &begin_cpu); + return mask; + while (!feof(file)) { + skip_ws(file); + n = fscanf(file, "%d", &begin_cpu); if (n != 1) break; - skip_ws(offline_file); - int c = fgetc(offline_file); + skip_ws(file); + int c = fgetc(file); if (c == EOF || c == ',') { // Just single CPU end_cpu = begin_cpu; } else if (c == '-') { // Range of CPUs - skip_ws(offline_file); - n = fscanf(offline_file, "%d", &end_cpu); + skip_ws(file); + n = fscanf(file, "%d", &end_cpu); if (n != 1) break; - skip_ws(offline_file); - c = fgetc(offline_file); // skip ',' + skip_ws(file); + c = fgetc(file); // skip ',' } else { // Syntax problem break; @@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { end_cpu >= __kmp_xproc || begin_cpu > end_cpu) { continue; } - // Insert [begin_cpu, end_cpu] into offline mask + // Insert [begin_cpu, end_cpu] into mask for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) { - KMP_CPU_SET(cpu, offline); + KMP_CPU_SET(cpu, mask); } } #endif - return offline; + return mask; +} + +// Return (possibly empty) affinity mask representing the offline CPUs +// Caller must free the mask +kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline"); } // Return the number of available procs @@ -3175,6 +3179,37 @@ static inline const char *__kmp_cpuinfo_get_envvar() { return envvar; } +static bool __kmp_package_id_from_core_siblings_list(unsigned **threadInfo, + unsigned num_avail, + unsigned idx) { + if (!KMP_AFFINITY_CAPABLE()) + return false; + + char path[256]; + KMP_SNPRINTF(path, sizeof(path), + "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", + threadInfo[idx][osIdIndex]); + kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); + for (unsigned i = 0; i < num_avail; ++i) { + unsigned cpu_id = threadInfo[i][osIdIndex]; + KMP_ASSERT(cpu_id < __kmp_affin_mask_size * CHAR_BIT); + if (!KMP_CPU_ISSET(cpu_id, siblings)) + continue; + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + // Arbitrarily pick the first index we encounter, it only matters that + // the value is the same for all siblings. + threadInfo[i][pkgIdIndex] = idx; + } else if (threadInfo[i][pkgIdIndex] != idx) { + // Contradictory sibling lists. + KMP_CPU_FREE(siblings); + return false; + } + } + KMP_ASSERT(threadInfo[idx][pkgIdIndex] != UINT_MAX); + KMP_CPU_FREE(siblings); + return true; +} + // Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the // affinity map. On AIX, the map is obtained through system SRAD (Scheduler // Resource Allocation Domain). @@ -3550,18 +3585,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, return false; } - // Check for missing fields. The osId field must be there, and we - // currently require that the physical id field is specified, also. + // Check for missing fields. The osId field must be there. The physical + // id field will be checked later. if (threadInfo[num_avail][osIdIndex] == UINT_MAX) { CLEANUP_THREAD_INFO; *msg_id = kmp_i18n_str_MissingProcField; return false; } - if (threadInfo[0][pkgIdIndex] == UINT_MAX) { - CLEANUP_THREAD_INFO; - *msg_id = kmp_i18n_str_MissingPhysicalIDField; - return false; - } // Skip this proc if it is not included in the machine model. if (KMP_AFFINITY_CAPABLE() && @@ -3591,6 +3621,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, } *line = 0; + // At least on powerpc, Linux may return -1 for physical_package_id. Try + // to reconstruct topology from core_siblings_list in that case. + for (i = 0; i < num_avail; ++i) { + if (threadInfo[i][pkgIdIndex] == UINT_MAX) { + if (!__kmp_package_id_from_core_siblings_list(threadInfo, num_avail, i)) { + CLEANUP_THREAD_INFO; + *msg_id = kmp_i18n_str_MissingPhysicalIDField; + return false; + } + } + } + #if KMP_MIC && REDUCE_TEAM_SIZE unsigned teamSize = 0; #endif // KMP_MIC && REDUCE_TEAM_SIZE diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c index 606fcdfbada95a..0b49969bd3b10c 100644 --- a/openmp/runtime/test/affinity/kmp-hw-subset.c +++ b/openmp/runtime/test/affinity/kmp-hw-subset.c @@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, expected_per_place = nthreads_per_core; } else { expected_total = nsockets; - expected_per_place = ncores_per_socket; + expected_per_place = ncores_per_socket * nthreads_per_core; } if (openmp_places->num_places != expected_total) { fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n"); From openmp-commits at lists.llvm.org Fri Oct 11 12:18:25 2024 From: openmp-commits at lists.llvm.org (Jonathan Peyton via Openmp-commits) Date: Fri, 11 Oct 2024 12:18:25 -0700 (PDT) Subject: [Openmp-commits] [openmp] [openmp] Use core_siblings_list if physical_package_id not available (PR #111831) In-Reply-To: Message-ID: <67097a01.050a0220.c49f9.bd4f@mx.google.com> https://github.com/jpeyton52 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111831