[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-06 Thread David Truby via cfe-commits
DavidTruby wrote: I have force pushed this to my branch but github doesn't seem to be picking it up on this review?? I don't really know how to fix this. https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2024-12-12 Thread David Truby via cfe-commits
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/119718 This patch adds the -fvectorize and -fno-vectorize flags to flang. Note that this also changes the behaviour of `flang -fc1` to match that of `clang -cc1`, which is that vectorization is only enabled in the

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2024-12-12 Thread David Truby via cfe-commits
https://github.com/DavidTruby converted_to_draft https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2024-12-16 Thread David Truby via cfe-commits
@@ -6980,3 +6980,37 @@ void driver::applyOverrideOptions(SmallVectorImpl &Args, ++S; } } + +/// Vectorize at all optimization levels greater than 1 except for -Oz. +/// For -Oz the loop vectorizer is disabled, while the slp vectorizer is +/// enabled. +bool driver::shou

[clang] [flang] [flang][Driver] Don't require -fno-integrated-as when using -save-temps (PR #119624)

2024-12-16 Thread David Truby via cfe-commits
DavidTruby wrote: That's interesting, there _is_ an external assembler on Windows; in fact, LLVM itself builds one (llvm-ml.exe) as well as MSVC providing one (ml.exe). I wonder why we can't just use llvm-ml here, since we know it must be available? I can have a look if this works for clang. I

[clang] [flang] [Flang][OpenMP] Add -fopenmp-default-none command line flag (PR #120287)

2024-12-17 Thread David Truby via cfe-commits
DavidTruby wrote: Would it be a lot of work to add this flag for `clang` as well? It seems like the behaviour would be equally useful there and I would prefer us to keep flags available for both compilers where it makes sense. In terms of implementation it looks like there's already a clang-ti

[clang] [flang] [Flang][OpenMP] Add -fopenmp-default-none command line flag (PR #120287)

2024-12-17 Thread David Truby via cfe-commits
https://github.com/DavidTruby commented: Would it be a lot of work to add this flag for clang as well? It seems like the behaviour would be equally useful there and I would prefer us to keep flags available for both compilers where it makes sense. In terms of implementation it looks like there'

[clang] [flang] [Flang][Driver] Deprecate Ofast (PR #101701)

2025-01-21 Thread David Truby via cfe-commits
https://github.com/DavidTruby approved this pull request. LGTM, I'm glad we're matching clang's behaviour here. Thanks! https://github.com/llvm/llvm-project/pull/101701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-22 Thread David Truby via cfe-commits
DavidTruby wrote: I guess the tests in this should have had --target= for the targets I checked them on (x86_64 and aarch64). I can add those and remove the xfail? https://github.com/llvm/llvm-project/pull/122906 ___ cfe-commits mailing list cfe-commi

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
@@ -150,12 +150,17 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Args.addAllArgs(CmdArgs, {options::OPT_flang_experimental_hlfir, +options::OPT_flang_depr

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/122906 >From c9b2e5855fdbbaafb5512e1e2539983201202b25 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 8 Jan 2025 11:19:38 + Subject: [PATCH 1/3] [flang] Add -f[no-]unroll-loops flag This patch adds suppor

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %flang_fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=1 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL DavidTruby wrote: Actually, source->HLFIR isn't useful. I'll add a source->llvm integration test. https://github.

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/122906 >From c9b2e5855fdbbaafb5512e1e2539983201202b25 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 8 Jan 2025 11:19:38 + Subject: [PATCH 1/4] [flang] Add -f[no-]unroll-loops flag This patch adds suppor

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/122906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/122906 This patch adds support for the -funroll-loops and -fno-unroll-loops flags with similar behaviour to clang. funroll-loops is enabled at -O2 onwards as is the current default. >From c9b2e5855fdbbaafb5512e1e2

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/122906 >From c9b2e5855fdbbaafb5512e1e2539983201202b25 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 8 Jan 2025 11:19:38 + Subject: [PATCH 1/2] [flang] Add -f[no-]unroll-loops flag This patch adds suppor

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %flang_fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=1 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL DavidTruby wrote: I guess we should possibly have all 3? A source to HLFIR, this test, and source->llvmir? http

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
@@ -0,0 +1,37 @@ +! RUN: %flang_fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=2 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL +! RUN: %flang_fc1 -emit-llvm -O2 -mllvm -force-vector-width=2 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL +! RUN: %flang_fc

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-14 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/122906 >From c9b2e5855fdbbaafb5512e1e2539983201202b25 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 8 Jan 2025 11:19:38 + Subject: [PATCH 1/5] [flang] Add -f[no-]unroll-loops flag This patch adds suppor

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-15 Thread David Truby via cfe-commits
https://github.com/DavidTruby closed https://github.com/llvm/llvm-project/pull/122906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]unroll-loops flag (PR #122906)

2025-01-15 Thread David Truby via cfe-commits
@@ -0,0 +1,37 @@ +! RUN: %flang_fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=2 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL +! RUN: %flang_fc1 -emit-llvm -O2 -mllvm -force-vector-width=2 -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL +! RUN: %flang_fc

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-05 Thread David Truby via cfe-commits
https://github.com/DavidTruby approved this pull request. LGTM thanks! https://github.com/llvm/llvm-project/pull/134002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-04-05 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/133775 >From aeca7c2c7bf4cc7aef87374f3890f2a42e61d07d Mon Sep 17 00:00:00 2001 From: David Truby Date: Mon, 31 Mar 2025 19:39:37 +0100 Subject: [PATCH 1/2] [flang] Complete alignment of -x language modes with gfort

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-04-05 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -817,8 +817,13 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // 'flang -E' always produces output that is suitable for use as fixed form // Fortran. However it is only valid free form sourc

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-26 Thread David Truby via cfe-commits
https://github.com/DavidTruby approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/132801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-04-10 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/133775 >From aeca7c2c7bf4cc7aef87374f3890f2a42e61d07d Mon Sep 17 00:00:00 2001 From: David Truby Date: Mon, 31 Mar 2025 19:39:37 +0100 Subject: [PATCH 1/3] [flang] Complete alignment of -x language modes with gfort

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -863,6 +863,12 @@ static void parsePreprocessorArgs(Fortran::frontend::PreprocessorOptions &opts, (currentArg->getOption().matches(clang::driver::options::OPT_cpp)) ? PPMacrosFlag::Include

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-03-31 Thread David Truby via cfe-commits
@@ -88,8 +88,8 @@ TYPE("assembler-with-cpp", Asm, PP_Asm, "S", phases // modules when Flang needs to emit pre-processed files. Therefore, the // `PP_TYPE` is set to `PP_Fortran` so that the driver is fine with // "pre-processing a pre-processed fil

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -817,8 +817,13 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // 'flang -E' always produces output that is suitable for use as fixed form // Fortran. However it is only valid free form sourc

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-04-16 Thread David Truby via cfe-commits
https://github.com/DavidTruby closed https://github.com/llvm/llvm-project/pull/133775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread David Truby via cfe-commits
@@ -892,6 +909,20 @@ static void generateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine &diags, delete tlii; } + +// Default filename used for profile generation. +namespace llvm { + extern llvm::cl::opt DebugInfoCorrelate; + extern llvm::cl::opt ProfileCorrelate; +

[clang] [Clang][CodeGen] Add workaround for old glibc `__PTR_ALIGN` macro (PR #137851)

2025-04-29 Thread David Truby via cfe-commits
DavidTruby wrote: This fixes an issue I was seeing caused by #130742 that caused GNU m4 and make builds to segfault, which I assume was caused by #137833. I don't understand the code here well enough to give an actual review, but it'd be great to see this merged as m4/make builds generating ba

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-17 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/119718 >From af135a1a4156be9076931ceeb92f75171a0cb7ad Mon Sep 17 00:00:00 2001 From: David Truby Date: Thu, 12 Dec 2024 14:50:19 + Subject: [PATCH] [flang] Add -f[no-]vectorize flags --- clang/include/clang/Dr

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-17 Thread David Truby via cfe-commits
DavidTruby wrote: It looks like the force push has worked this time. Sorry it took so long to do, I was on holiday. https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread David Truby via cfe-commits
@@ -3986,11 +3986,15 @@ defm assumptions : BoolFOption<"assumptions", "Disable codegen and compile-time checks for C++23's [[assume]] attribute">, PosFlag>; + +let Visibility = [ClangOption, FlangOption] in { DavidTruby wrote: The docs [here](ht

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread David Truby via cfe-commits
https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread David Truby via cfe-commits
@@ -6980,3 +6980,37 @@ void driver::applyOverrideOptions(SmallVectorImpl &Args, ++S; } } + +/// Vectorize at all optimization levels greater than 1 except for -Oz. +/// For -Oz the loop vectorizer is disabled, while the slp vectorizer is +/// enabled. +bool driver::shou

[clang] [flang] [flang/clang] Adding use of Clang's diagnostics in Flang (PR #130593)

2025-03-10 Thread David Truby via cfe-commits
DavidTruby wrote: Some extra context: there was a discussion quite some time ago about moving lots of the driver/diagnostic code from `clang` to a separate top-level LLVM project, and I believe it was generally agreed that this would be a good idea: https://discourse.llvm.org/t/rfc-refactor-cl

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby approved this pull request. This LGTM now when @tarunprabhu is happy, thanks for seeing this through despite my lengthy comments! This isn't to hold up this patch, but as a separate thought: I wonder if

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-20 Thread David Truby via cfe-commits
https://github.com/DavidTruby closed https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-03-31 Thread David Truby via cfe-commits
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/133775 This fixes an issue where, since the alignment of the -x lanaguage modes, .f90 files were being preprocessed by default. This patch completes the alignment of the meaning of the f95-pp-input and f95 language m

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: DavidTruby wrote: I've created a PR at #133775 cleaning up the meanings of the `-x` options in the compiler driver, which I believe resolves the above issue but leaves this fix in place. If you could check that it still works for you

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-04-02 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/133775 >From aeca7c2c7bf4cc7aef87374f3890f2a42e61d07d Mon Sep 17 00:00:00 2001 From: David Truby Date: Mon, 31 Mar 2025 19:39:37 +0100 Subject: [PATCH 1/2] [flang] Complete alignment of -x language modes with gfort

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-18 Thread David Truby via cfe-commits
https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/144710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-18 Thread David Truby via cfe-commits
DavidTruby wrote: Looks like the pre-commit CI has compiler-rt in LLVM_ENABLE_PROJECTS. I thought that wasn't supported anymore? Anyways I guess I have to add a check that it's not in ENABLE_PROJECTS as well as ENABLE_RUNTIMES https://github.com/llvm/llvm-project/pull/144710 __

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-18 Thread David Truby via cfe-commits
@@ -653,6 +653,13 @@ if(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD STREQUAL "all") set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${LLVM_ALL_EXPERIMENTAL_TARGETS}) endif() +if("flang" IN_LIST LLVM_ENABLE_PROJECTS AND + "AArch64" IN_LIST LLVM_TARGETS_TO_BUILD AND + NOT "compiler-rt" IN_

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-23 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/144710 >From 2c278271277823b3544d991365e58f97dd4b7031 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 18 Jun 2025 10:17:05 +0100 Subject: [PATCH 1/2] [flang][AArch64] Always compiler-rt to flang linking after

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-05 Thread David Truby via cfe-commits
https://github.com/DavidTruby approved this pull request. LGTM thanks for removing the duplication here! https://github.com/llvm/llvm-project/pull/142800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-24 Thread David Truby via cfe-commits
https://github.com/DavidTruby closed https://github.com/llvm/llvm-project/pull/144710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-03 Thread David Truby via cfe-commits
@@ -518,6 +518,27 @@ bool AArch64FrameLowering::hasFPImpl(const MachineFunction &MF) const { return false; } +/// Should the Frame Pointer be reserved for the current function? +bool AArch64FrameLowering::isFPReserved(const MachineFunction &MF) const { + const TargetMachin

<    1   2   3