[clang] [flang] [flang] add fveclib flag (PR #71734)

2023-11-08 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/71734 -fveclib= allows users to choose a vectorized libm so that loops containing math functions are vectorized. This is implemented as much as possible in the same way as in clang. The driver test in veclib.f90 is copi

[clang] [flang] [flang][driver] add -flang-deprecated-no-hlfir hidden option (PR #71820)

2023-11-09 Thread Tom Eccles via cfe-commits
@@ -1073,6 +1073,12 @@ bool CompilerInvocation::createFromArgs( res.loweringOpts.setLowerToHighLevelFIR(true); } + // -flang-deprecated-no-hlfir + if (args.hasArg(clang::driver::options::OPT_flang_deprecated_no_hlfir) && + !args.hasArg(clang::driver::options::OPT_

[clang] [flang] [flang][driver] add -flang-deprecated-no-hlfir hidden option (PR #71820)

2023-11-09 Thread Tom Eccles via cfe-commits
https://github.com/tblah requested changes to this pull request. Thanks for this! Please could you also add testing in flang/Driver/frontend-forwarding.f90, flang/test/HLFIR/hlfir-flang.f90 https://github.com/llvm/llvm-project/pull/71820 ___ cfe-comm

[clang] [flang] [flang][driver] add -flang-deprecated-no-hlfir hidden option (PR #71820)

2023-11-09 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/71820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] add -flang-deprecated-no-hlfir hidden option (PR #71820)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. > Thanks for the review @tblah. I could not find > flang/test/HLFIR/hlfir-flang.f90 test, did you mean > flang/test/HLFIR/hlfir-**flags**.f90 (in which case it is updated in this PR > already). Yes I meant hlfir-flags.f90. Sorry about that.

[llvm] [flang] [clang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/71734 >From ac9c18ef7d286147fd1ae4a49efe343644d2ccd1 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 7 Nov 2023 18:55:20 + Subject: [PATCH 1/2] [flang] add fveclib flag -fveclib= allows users to choose a vectori

[llvm] [clang] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
@@ -111,7 +111,7 @@ int main(int argc, const char **argv) { auto Files = llvm::makeIntrusiveRefCnt(FileSystemOptions(), OFS); - auto Driver = std::make_unique( + auto Driver = std::make_unique( tblah wrote: The file imports both the `clang` and `llvm` n

[llvm] [clang] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,13 @@ +! test that -fveclib= is passed to the backend +! -target aarch64 so that ArmPL is available +! RUN: %flang -S -target aarch64-unknown-linux-gnu -mcpu=neoverse-v1 -Ofast -fveclib=ArmPL -o - %s | FileCheck %s + tblah wrote: -fveclib should work

[clang] [llvm] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/71734 >From ac9c18ef7d286147fd1ae4a49efe343644d2ccd1 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 7 Nov 2023 18:55:20 + Subject: [PATCH 1/3] [flang] add fveclib flag -fveclib= allows users to choose a vectori

[clang] [llvm] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/71734 >From ac9c18ef7d286147fd1ae4a49efe343644d2ccd1 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 7 Nov 2023 18:55:20 + Subject: [PATCH 1/4] [flang] add fveclib flag -fveclib= allows users to choose a vectori

[llvm] [clang] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/71734 >From ac9c18ef7d286147fd1ae4a49efe343644d2ccd1 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 7 Nov 2023 18:55:20 + Subject: [PATCH 1/4] [flang] add fveclib flag -fveclib= allows users to choose a vectori

[clang] [llvm] [flang] [flang] add fveclib flag (PR #71734)

2023-11-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/71734 >From ac9c18ef7d286147fd1ae4a49efe343644d2ccd1 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 7 Nov 2023 18:55:20 + Subject: [PATCH 1/5] [flang] add fveclib flag -fveclib= allows users to choose a vectori

[flang] [clang] [llvm] [flang] add fveclib flag (PR #71734)

2023-11-13 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/71734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-14 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM with Andrzej's comments https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] remove -f[no-]alias-analysis (PR #74343)

2023-12-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/74343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks for the fix. LGTM https://github.com/llvm/llvm-project/pull/74139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Update -falias-analysis help text (PR #73548)

2023-12-05 Thread Tom Eccles via cfe-commits
tblah wrote: Closing this because I decided to just remove the `-f[no-]alias-analysis` flags instead. https://github.com/llvm/llvm-project/pull/74343 https://github.com/llvm/llvm-project/pull/73548 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[flang] [clang] [flang] Update -falias-analysis help text (PR #73548)

2023-12-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/73548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] WIP: [flang] Enable fir alias tags pass by default when optimizing for speed (PR #68597)

2023-11-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/68597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] WIP: [flang] Enable fir alias tags pass by default when optimizing for speed (PR #68597)

2023-11-22 Thread Tom Eccles via cfe-commits
tblah wrote: Sorry for the noise all. Closing and re-creating to avoid pinging everyone with review https://github.com/llvm/llvm-project/pull/68597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/73111 Enable by default when optimizing for speed. For simplicity, only forward the flag to the frontend driver when it contradicts what is implied by the optimization level. Since https://github.com/llvm/llvm-project/p

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/73111 >From 617d6d23b2f861cd6dceb82f54a2685059b6 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 14 Sep 2023 09:09:29 + Subject: [PATCH 1/2] [flang] Enable alias tags pass by default Enable by default when o

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/73111 >From 617d6d23b2f861cd6dceb82f54a2685059b6 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 14 Sep 2023 09:09:29 + Subject: [PATCH 1/3] [flang] Enable alias tags pass by default Enable by default when o

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/73111 >From 617d6d23b2f861cd6dceb82f54a2685059b6 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 14 Sep 2023 09:09:29 + Subject: [PATCH 1/4] [flang] Enable alias tags pass by default Enable by default when o

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Tom Eccles via cfe-commits
tblah wrote: > Thank you for the changes, Tom! > > I have one minor comment, but I would like to ask to merge this after US > holidays, if possible. Could you please postpone the merging until Monday GMT? Sure. I'll wait until Monday. https://github.com/llvm/llvm-project/pull/73111 __

[flang] [clang] WIP: [flang] Enable fir alias tags pass by default when optimizing for speed (PR #68597)

2023-11-02 Thread Tom Eccles via cfe-commits
tblah wrote: Hi @vzakhari, currently there is a serious performance regression in spec2017 exchange2. With the TBAA tags we produce slightly better code (less repeated loads, hoisting some code out of loops, etc). Unfortunately, this change to the generated code causes LLVM's function speciali

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/73111 >From 617d6d23b2f861cd6dceb82f54a2685059b6 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 14 Sep 2023 09:09:29 + Subject: [PATCH 1/6] [flang] Enable alias tags pass by default Enable by default when o

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/73111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -6752,10 +6754,7 @@ def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">, def mdebug_pass : Separate<["-"], "mdebug-pass">, HelpText<"Enable additional debug output">, MarshallingInfoString>; -def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">, - HelpTe

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah requested changes to this pull request. While I guess it isn't wrong, it feels weird do declare all of the storage on the front end driver side, but never set them (the member of the CodeGenOpttions class, the changes in Frontend/CodeGenOptions.h, adding it to MLIRToLL

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -1114,7 +1114,8 @@ bool CompilerInvocation::createFromArgs( res.loweringOpts.setLowerToHighLevelFIR(false); } - if (args.hasArg(clang::driver::options::OPT_flang_experimental_polymorphism)) { + if (args.hasArg( tblah wrote: This looks unrelated to

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-23 Thread Tom Eccles via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/73111 >From 617d6d23b2f861cd6dceb82f54a2685059b6 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 14 Sep 2023 09:09:29 + Subject: [PATCH 1/8] [flang] Enable alias tags pass by default Enable by default when o

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-27 Thread Tom Eccles via cfe-commits
@@ -2,12 +2,25 @@ ! See flang/test/Fir/tbaa-codegen.fir for a test that the output is correct ! RUN: %flang -c -emit-llvm -falias-analysis %s -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-AA --check-prefix=CHECK-ALL -! RUN: %flang -c -emit-llvm -falias-analysis -fno-ali

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-27 Thread Tom Eccles via cfe-commits
tblah wrote: > If you are in a rush to land this then this LGTM, but I would like the > relationship between `-O{1|2|3|4}` and `-f{no}-alias-analysis` to be refined > in a follow-up patch. Unless there's a good reason to avoid that? WDYT? Thanks @banach-space, I will land this now and follow u

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/73111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Update -falias-analysis help text (PR #73548)

2023-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/73548 As requested by @branach-space on #73111. This makes it clearer that -f[no-]alias-analysis will always override -O flags, no matter their ordering. >From d65bd2855b170cffdcf04b2052dfa8aec37b4722 Mon Sep 17 00:00:00

[flang] [clang] [flang] Update -falias-analysis help text (PR #73548)

2023-11-27 Thread Tom Eccles via cfe-commits
tblah wrote: @banach-space I'm happy to change the behavior too if you'd prefer that https://github.com/llvm/llvm-project/pull/73548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-27 Thread Tom Eccles via cfe-commits
@@ -49,6 +49,7 @@ class CodeGenOptionsBase { class CodeGenOptions : public CodeGenOptionsBase { public: + tblah wrote: nit: unrelated change https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing l

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for the update. See my previous comment about the changes to `MLIRToLLVMPassPipelineConfig` and `CodeGenOptions.def`. https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@l

[clang] [flang] [flang] Update -falias-analysis help text (PR #73548)

2023-11-28 Thread Tom Eccles via cfe-commits
@@ -6334,8 +6334,8 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri PosFlag, NegFlag>; defm alias_analysis : BoolOptionWithoutMarshalling<"f", "alias-analysis", - PosFlag, - NegFlag>; + PosFlag, + NegFlag>; } // let Visibility = [FC

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-29 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-29 Thread Tom Eccles via cfe-commits
tblah wrote: > LGTM, thanks! But please fix code formatting before merging https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] Revert "[flang] Enable alias tags pass by default (#73111)" (PR #73821)

2023-11-29 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/73821 This reverts commit caba0314cf631a3ba3e982cbcdc455224046c7a8. Serious performance regressions were reported by @vzakhari https://github.com/llvm/llvm-project/issues/58303#issuecomment-1830754173 Fixing this doesn'

[clang] [flang] Revert "[flang] Enable alias tags pass by default (#73111)" (PR #73821)

2023-11-29 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/73821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: Since this patch, I can no longer build spec2006 gromacs and calculix because they supply their own main function in a C file, then link using flang-new: leading to another definition of `main()` from the runtime. Do I need to use a special flag to avoid linking to libFortran_mai

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: Yes they are mixed source projects. They worked previously because the main function from `Frotran_main` was silently ignored. I don't know if this was accidental or not, but it tended to do the right thing for mixed source projects because if the user intended to use `Fortran_mai

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: Simple reproducer: main.c ``` int main(void) { // call fortran code return 0; } ``` fortran.f90 ``` function pow(a, b) real :: a, b, pow pow = a ** b end function ``` ``` clang -c main.c -o main.o flang-now -c fortran.f90 -o fortran.o flang-new fortran.o main.o -o out ```

[clang] ea4eb69 - [Flang][Clang] Add support for frame pointers in Flang

2023-12-01 Thread Tom Eccles via cfe-commits
Author: Radu Salavat Date: 2023-12-01T17:09:59Z New Revision: ea4eb691f4955e3b784ebf9bc94a47186838c6f2 URL: https://github.com/llvm/llvm-project/commit/ea4eb691f4955e3b784ebf9bc94a47186838c6f2 DIFF: https://github.com/llvm/llvm-project/commit/ea4eb691f4955e3b784ebf9bc94a47186838c6f2.diff LOG:

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: Merged manually https://github.com/llvm/llvm-project/commit/ea4eb691f4955e3b784ebf9bc94a47186838c6f2 https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-12-01 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: That example is quite different because you used `program` in the fortran source. The use case here is applications which implement `main` in C then call into fortran code https://github.com/llvm/llvm-project/pull/73124 ___ cfe-commits m

[flang] [clang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-01 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/74120 Reverts llvm/llvm-project#73124 This caused a regression building programs which implement `main()` in C and then call into some Fortran code, and which link using `flang-new`. reproducer: main.c ``` int main(void

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: > > That example is different because you used `program` in the fortran source. > > The use case here is applications which implement `main` in C then call > > into fortran code > > Do you have a link line for ifort? It seems that your example fails with > ifort, but indeed works

[flang] [clang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: For what it's worth, `armflang` follows gfortran's behavior. As there isn't consensus amongst fortran compilers, I'm unsure which behavior we should follow. What do other's think? https://github.com/llvm/llvm-project/pull/74120 ___ cfe-c

[clang] [flang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-01 Thread Tom Eccles via cfe-commits
tblah wrote: > Could you please see if `-Wl,--allow-multiple-definition` would help to > resolve the issue in the application? Surprisingly not. ``` ld.lld: error: undefined symbol: _QQEnvironmentDefaults >>> referenced by Fortran_main.c >>> Fortran_main.c.o:(.text.main+0x8) in a

[flang] [clang] [flang] (Re-)Enable alias tags pass by default (PR #74250)

2023-12-03 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/74250 Enable by default for optimization levels higher than 0 (same behavior as clang). For simplicity, only forward the flag to the frontend driver when it contradicts what is implied by the optimization level. This w

[flang] [clang] [flang] (Re-)Enable alias tags pass by default (PR #74250)

2023-12-03 Thread Tom Eccles via cfe-commits
tblah wrote: @banach-space once this is in, I'll remove `-f[no-]alias-analysis` in a separate patch, as it didn't turn out to be as useful for debugging as I expected (the `-mllvm` option is more specific), and as you mentioned - these arguments are non-standard. https://github.com/llvm/llvm-

[flang] [clang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-04 Thread Tom Eccles via cfe-commits
tblah wrote: > @tblah Would you mind trying this new option with one application code to see > if that will help? Yes this flag works for me, thanks! I think it would be a shame to require a flag not needed for classic-flang or gfortran, but we can come back to this. This solution is good eno

[clang] [flang] [flang] (Re-)Enable alias tags pass by default (PR #74250)

2023-12-04 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/74250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] remove -f[no-]alias-analysis (PR #74343)

2023-12-04 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/74343 Now that tbaa tags pass is enabled by default, I would like to remove these flags. `-fno-alias-analysis` was originally intended to be useful for debugging, but as it also disables tbaa tag generation in codegen, i

[clang] [flang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-21 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/74120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" (PR #74120)

2023-12-21 Thread Tom Eccles via cfe-commits
tblah wrote: Closing because this was superseded by https://github.com/llvm/llvm-project/pull/74139 https://github.com/llvm/llvm-project/pull/74120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[llvm] [clang-tools-extra] [flang] [clang] [flang] Add EXECUTE_COMMAND_LINE runtime and lowering intrinsics implementation (PR #74077)

2024-01-10 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,206 @@ +//===-- runtime/execute.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[flang] [clang] [flang] Fix fveclib on Darwin (PR #77605)

2024-01-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Makes sense. For reference, here I was trying to reproduce the logic from https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L5364 and https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChai

[clang-tools-extra] [llvm] [flang] [clang] [flang] Add EXECUTE_COMMAND_LINE runtime and lowering intrinsics implementation (PR #74077)

2024-01-11 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,206 @@ +//===-- runtime/execute.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-27 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [FLANG] allow -fopenmp= (PR #86816)

2024-03-28 Thread Tom Eccles via cfe-commits
@@ -764,6 +762,32 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // Add other compile options addOtherOptions(Args, CmdArgs); + // Forward flags for OpenMP. We don't do this if the current action is an + // device offloading action other than OpenMP. +

[clang] [flang] [flang] Add --gcc-toolchain and --gcc-install-dir options to flang. (PR #87360)

2024-04-02 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Overall this looks good. Just minor comments. Thank you for working on this! https://github.com/llvm/llvm-project/pull/87360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [flang] [flang] Add --gcc-toolchain and --gcc-install-dir options to flang. (PR #87360)

2024-04-02 Thread Tom Eccles via cfe-commits
tblah wrote: Does this need `#!/bin/true`? https://github.com/llvm/llvm-project/pull/87360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add --gcc-toolchain and --gcc-install-dir options to flang. (PR #87360)

2024-04-02 Thread Tom Eccles via cfe-commits
tblah wrote: What is this file for? https://github.com/llvm/llvm-project/pull/87360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add --gcc-toolchain and --gcc-install-dir options to flang. (PR #87360)

2024-04-02 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/87360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][draft] Improve debug info generation. (PR #84202)

2024-03-07 Thread Tom Eccles via cfe-commits
tblah wrote: Thank you for this patch! I like the approach so far using the existing debug pass. My gut feeling is that I would rather this happen in a pass rather than earlier on (lowering or even semantics) because lowering is already too complicated and monolithic. In the past it has prove

[clang] [flang] [flang] Enable polymorphic lowering by default (PR #83285)

2024-02-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM. On a quick run this seems to pass everything I would expect it to in the gfortran test suite. When you get time please could you enable the polymorphic tests in the gfortran test suite and re-categorize the ones which now hit different

[clang] [flang] [flang] Enable polymorphic lowering by default (PR #83285)

2024-02-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/83285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Enable polymorphic lowering by default (PR #83285)

2024-02-28 Thread Tom Eccles via cfe-commits
tblah wrote: A few of the tests in the gfortran-testsuite using polymorphism fail at runtime. I'm happy for this PR to be merged as it is and these bugs to be fixed later. https://github.com/llvm/llvm-project/pull/83285 ___ cfe-commits mailing list c

[flang] [clang-tools-extra] [clang] [llvm] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
@@ -1393,6 +1393,11 @@ static const IntrinsicInterface intrinsicSubroutine[]{ {"get", DefaultInt, Rank::vector, Optionality::optional, common::Intent::Out}}, {}, Rank::elemental, IntrinsicClass::impureSubroutine}, +{"system", +{{"

[clang] [llvm] [flang] [clang-tools-extra] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for your work so far. I have a few questions https://github.com/llvm/llvm-project/pull/74309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [llvm] [clang-tools-extra] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/74309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [flang] [clang] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
@@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::Exte

[clang] [llvm] [flang] [clang-tools-extra] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
@@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::Exte

[clang-tools-extra] [clang] [flang] [llvm] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
@@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::Exte

[flang] [clang-tools-extra] [clang] [llvm] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-26 Thread Tom Eccles via cfe-commits
@@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::Exte

[clang] [clang-tools-extra] [llvm] [flang] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

2024-01-29 Thread Tom Eccles via cfe-commits
@@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::Exte

  1   2   3   4   >