[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-21 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-15 Thread Tom Eccles via cfe-commits
tblah wrote: > Who said it is a temporary solution? Can you point to an RFC? This specific patch wasn't discussed in the RFC but there is some discussion here https://discourse.llvm.org/t/rfc-add-fir-affine-optimization-fir-pass-pipeline/86190/5 https://github.com/llvm/llvm-project/pull/13985

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-14 Thread Tom Eccles via cfe-commits
https://github.com/tblah requested changes to this pull request. The code changes look okay here but I think the naming should reflect that the lowering to upstream MLIR dialects will be considered experimental (and may remain so forever, if it cannot be made to fully conform to Fortran semanti

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-05-02 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/137996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-05-01 Thread Tom Eccles via cfe-commits
@@ -81,6 +81,8 @@ class CodeGenOptions : public CodeGenOptionsBase { /// Options to add to the linker for the object file std::vector DependentLibs; + bool InstrumentFunctions{false}; tblah wrote: This could be stored more efficiently by putting it in Co

[clang] [llvm] [mlir] [mlir][OpenMP] convert wsloop cancellation to LLVMIR (PR #137194)

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

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

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

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-29 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/137193 >From fac4240f2c217a9e48ab2eb8eeffb818f5c3a9ff Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 10 Apr 2025 11:43:18 + Subject: [PATCH 1/3] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR This is qui

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-28 Thread Tom Eccles via cfe-commits
tblah wrote: The test failures look unrelated to my patch. https://github.com/llvm/llvm-project/pull/137193 ___ 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 Tom Eccles via cfe-commits
@@ -20,8 +20,13 @@ #include "mlir/IR/OwningOpRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include +namespace llvm { +extern cl::opt ClPGOColdFuncAttr; +} // namespace llvm --

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

2025-04-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for the updates https://github.com/llvm/llvm-project/pull/136098 ___ 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 Tom Eccles via cfe-commits
@@ -19,6 +21,7 @@ template class Expected; template class IntrusiveRefCntPtr; class Module; class MemoryBufferRef; +extern cl::opt ClPGOColdFuncAttr; tblah wrote: nit: I would put this `extern` in `BackendUtil.cpp` because it is not part of BackendUtils's p

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

2025-04-28 Thread Tom Eccles via cfe-commits
@@ -8,6 +8,8 @@ #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include "clang/Basic/LLVM.h" #include "llvm/IR/ModuleSummaryIndex.h" tblah wrote

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

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

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-28 Thread Tom Eccles via cfe-commits
tblah wrote: It turned out that the Windows failures were due to some UB in my patch. Clang (with the OMPIRBuilder backend) was actually doing almost exactly the same hack as I implement in this patch, which then interacted badly by my attempts to do the same thing in OMPIRBuilder. I have rem

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/137193 >From fac4240f2c217a9e48ab2eb8eeffb818f5c3a9ff Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 10 Apr 2025 11:43:18 + Subject: [PATCH 1/2] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR This is qui

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/137193 >From ba6d59cdb2bf906a60b7e13448af730bd2019140 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 8 Apr 2025 17:21:15 + Subject: [PATCH 1/4] [mlir][OpenMP] Convert omp.cancel parallel to LLVMIR Support for

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

2025-04-26 Thread Tom Eccles via cfe-commits
@@ -24,6 +24,11 @@ CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified. CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new ///< pass manager. +ENUM_CODEGENOPT(ProfileInstr, ProfileInstrKind, 2, Pro

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

2025-04-26 Thread Tom Eccles via cfe-commits
@@ -148,6 +148,55 @@ class CodeGenOptions : public CodeGenOptionsBase { /// OpenMP is enabled. using DoConcurrentMappingKind = flangomp::DoConcurrentMappingKind; + enum ProfileInstrKind { +ProfileNone, // Profile instrumentation is turned off. +ProfileClangI

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

2025-04-22 Thread Tom Eccles via cfe-commits
@@ -24,6 +24,11 @@ CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified. CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new ///< pass manager. +ENUM_CODEGENOPT(ProfileInstr, ProfileInstrKind, 2, Pro

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

2025-04-22 Thread Tom Eccles via cfe-commits
@@ -148,6 +148,55 @@ class CodeGenOptions : public CodeGenOptionsBase { /// OpenMP is enabled. using DoConcurrentMappingKind = flangomp::DoConcurrentMappingKind; + enum ProfileInstrKind { +ProfileNone, // Profile instrumentation is turned off. +ProfileClangI

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

2025-04-22 Thread Tom Eccles via cfe-commits
@@ -909,6 +940,29 @@ void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) { llvm::PassInstrumentationCallbacks pic; llvm::PipelineTuningOptions pto; std::optional pgoOpt; + + if (opts.hasProfileIRInstr()){ +// // -fprofile-generate.

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

2025-04-22 Thread Tom Eccles via cfe-commits
@@ -148,6 +148,55 @@ class CodeGenOptions : public CodeGenOptionsBase { /// OpenMP is enabled. using DoConcurrentMappingKind = flangomp::DoConcurrentMappingKind; + enum ProfileInstrKind { +ProfileNone, // Profile instrumentation is turned off. +ProfileClangI

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

2025-04-22 Thread Tom Eccles via cfe-commits
@@ -882,6 +882,14 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // TODO: Handle interactions between -w, -pedantic, -Wall, -WOption Args.AddLastArg(CmdArgs, options::OPT_w); + + if (Args.hasArg(options::OPT_fprofile_generate)){ +CmdArgs.push_back(

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

2025-04-22 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for contributing this https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [flang] [flang][OpenMP] Bump default OpenMP version to 3.1 (PR #133745)

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

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

2025-04-04 Thread Tom Eccles via cfe-commits
@@ -6961,6 +6960,52 @@ defm unsigned : OptInFC1FFlag<"unsigned", "Enables UNSIGNED type">; def fno_automatic : Flag<["-"], "fno-automatic">, Group, HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">; +defm repack_arrays +

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

2025-04-02 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM 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] Added driver options for arrays repacking. (PR #134002)

2025-04-02 Thread Tom Eccles via cfe-commits
@@ -1687,6 +1700,7 @@ void CompilerInvocation::setLoweringOptions() { const Fortran::common::LangOptions &langOptions = getLangOpts(); loweringOpts.setIntegerWrapAround(langOptions.getSignedOverflowBehavior() == Fortran::common::LangOptio

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

2025-04-02 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited 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][OpenMP] Bump default OpenMP version to 3.1 (PR #133745)

2025-03-31 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/133745 Precise OpenMP standards support information is being documented in #132707 Flang now has good support for OpenMP Version 3.1 and earlier. >From 3bce8b379641d8e91c8e8ae389a113f8d882b14e Mon Sep 17 00:00:00 2001 F

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

2025-03-26 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed 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] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-25 Thread Tom Eccles via cfe-commits
@@ -1,10 +1,15 @@ ! RUN: %flang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s ! RUN: %flang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +! RUN: %flang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=C

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

2025-03-24 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,10 @@ +! RUN: %flang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +! RUN: %flang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +! RUN: %flang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CH

[clang] [flang] [llvm] [mlir] [Transforms] Introduce BuildBuiltins.h atomic helpers (PR #101966)

2025-03-17 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,826 @@ +//===- BuildBuiltins.cpp - Utility builder for builtins ---===// +// +// 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] [llvm] [mlir] [Transforms] Introduce BuildBuiltins.h atomic helpers (PR #101966)

2025-03-17 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: The idea behind this sounds good to me, and this patch improves flang's test results on the fujitsu testsutie, shows no regressions in the gfortran test suite, and fixes the important remaining flang issues from omp atomic. Atomic support is one of the most

[clang] [flang] [llvm] [mlir] [Transforms] Introduce BuildBuiltins.h atomic helpers (PR #101966)

2025-03-17 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/101966 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

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

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-13 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/130788 >From 5d3c1cc1d40b308b93cc47c78c6c3ca677f55155 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 11 Mar 2025 15:54:35 + Subject: [PATCH 1/4] [flang] Add support for -f[no-]verbose-asm This flag provides ex

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-12 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/130788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-12 Thread Tom Eccles via cfe-commits
tblah wrote: No problem. I have moved it to target options in https://github.com/llvm/llvm-project/pull/130788/commits/6f6f8670887c9eb030412a7eb720242bba2790db https://github.com/llvm/llvm-project/pull/130788 ___ cfe-commits mailing list cfe-commits@l

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-12 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/130788 >From 5d3c1cc1d40b308b93cc47c78c6c3ca677f55155 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 11 Mar 2025 15:54:35 + Subject: [PATCH 1/3] [flang] Add support for -f[no-]verbose-asm This flag provides ex

[clang] [flang] [llvm] [mlir] [mlir][OpenMP] fix crash outlining infinite loop (PR #129872)

2025-03-11 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/129872 >From 3055b89b8ab937bfd4ba70d87e1733b05156d0ac Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 4 Mar 2025 17:19:53 + Subject: [PATCH 1/3] [mlir][OpenMP] fix crash outlining infinite loop Previously an ex

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-11 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/130788 >From 5d3c1cc1d40b308b93cc47c78c6c3ca677f55155 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 11 Mar 2025 15:54:35 + Subject: [PATCH 1/2] [flang] Add support for -f[no-]verbose-asm This flag provides ex

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-11 Thread Tom Eccles via cfe-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/130788 This flag provides extra commentary in the assembly output. It is in CodeGenOptions to match what is done in clang, even though the backend treats it as a target option. >From 5d3c1cc1d40b308b93cc47c78c6c3ca677f

[clang] [flang] [llvm] [mlir] [mlir][OpenMP] fix crash outlining infinite loop (PR #129872)

2025-03-07 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/129872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [mlir] [mlir][OpenMP] fix crash outlining infinite loop (PR #129872)

2025-03-05 Thread Tom Eccles via cfe-commits
tblah wrote: > The comment mentions the additional edges might come through cancellations, > but what test actually tests cancellation points? Thanks for taking a look. Now I have added clang lit tests (including for cancel) we can see that there are no changes beyond block names and removing

[clang] [flang] [llvm] [mlir] [mlir][OpenMP] fix crash outlining infinite loop (PR #129872)

2025-03-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/129872 >From 3055b89b8ab937bfd4ba70d87e1733b05156d0ac Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 4 Mar 2025 17:19:53 + Subject: [PATCH 1/2] [mlir][OpenMP] fix crash outlining infinite loop Previously an ex

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-24 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM thanks https://github.com/llvm/llvm-project/pull/126026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-19 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thank you for up-streaming this https://github.com/llvm/llvm-project/pull/126026 ___ 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-19 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM, thanks! 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][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-19 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,155 @@ + + +# `DO CONCURRENT` mapping to OpenMP + +```{contents} +--- +local: +--- +``` + +This document seeks to describe the effort to parallelize `do concurrent` loops +by mapping them to OpenMP worksharing constructs. The goals of this document +are: +* Describing h

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

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

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-19 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,155 @@ + + +# `DO CONCURRENT` mapping to OpenMP + +```{contents} +--- +local: +--- +``` + +This document seeks to describe the effort to parallelize `do concurrent` loops +by mapping them to OpenMP worksharing constructs. The goals of this document +are: +* Describing h

[clang] [flang] [flang][Driver] When linking with the Fortran runtime also link with libexecinfo (PR #125998)

2025-02-06 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks for coming back to this @brad0 https://github.com/llvm/llvm-project/pull/125998 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [flang] Reland "[Flang][Driver] Add a flag to control zero initialization" (PR #123606)

2025-01-20 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM. As I understand it the test failures were fixed by https://github.com/llvm/llvm-project/pull/123364 https://github.com/llvm/llvm-project/pull/123606 ___ cfe-commits mailing list cfe-commits@li

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

2025-01-15 Thread Tom Eccles via cfe-commits
@@ -933,10 +933,12 @@ def O : Joined<["-"], "O">, Group, def O_flag : Flag<["-"], "O">, Visibility<[ClangOption, CC1Option, FC1Option]>, Alias, AliasArgs<["1"]>; def Ofast : Joined<["-"], "Ofast">, Group, - Visibility<[ClangOption, CC1Option, FlangOption]>, - HelpTextForVar

[clang] [flang] [llvm] [mlir] [MLIR][OpenMP] Lowering aligned clause to LLVM IR for SIMD directive (PR #119536)

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

[clang] [flang] [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (PR #110063)

2024-12-18 Thread Tom Eccles via cfe-commits
tblah wrote: > Hello! Did anyone notice a performance regression after this PR on exchange2? > I see it on both EPYC 9684X and grace. The slowdown is more than 1.5x. > > I verified that performance restores when adding `-fwrapv` with the latest > flang compiler. The compilation options are `-O

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

2024-12-13 Thread Tom Eccles 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] Reland "[flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv" (PR #118933)

2024-12-06 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks for your patience and for bringing this back! https://github.com/llvm/llvm-project/pull/118933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [flang] [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (PR #110063)

2024-12-05 Thread Tom Eccles via cfe-commits
tblah wrote: Hi @yus3710-fj, thanks for investigating the cause of the regression. There was a recent patch which improved bwaves performance: https://github.com/llvm/llvm-project/pull/111853. It seems that since this patch, I no longer see a regression with the integer overflow enabled so I

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-27 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. The code changes look good to me. I am not at all familiar with LoongArch64 so it would be best if somebody else reviews that this implements the ABI correctly. https://github.com/llvm/llvm-project/pull/117108 ___

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-26 Thread Tom Eccles via cfe-commits
@@ -1151,6 +1154,311 @@ struct TargetLoongArch64 : public GenericTarget { return GenericTarget::integerArgumentType(loc, argTy); } + + /// Flatten non-basic types, resulting in an array of types containing only + /// `IntegerType` and `FloatType`. + std::vector flatt

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-26 Thread Tom Eccles via cfe-commits
@@ -1151,6 +1154,311 @@ struct TargetLoongArch64 : public GenericTarget { return GenericTarget::integerArgumentType(loc, argTy); } + + /// Flatten non-basic types, resulting in an array of types containing only + /// `IntegerType` and `FloatType`. + std::vector flatt

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-26 Thread Tom Eccles via cfe-commits
@@ -1151,6 +1154,311 @@ struct TargetLoongArch64 : public GenericTarget { return GenericTarget::integerArgumentType(loc, argTy); } + + /// Flatten non-basic types, resulting in an array of types containing only + /// `IntegerType` and `FloatType`. + std::vector flatt

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-26 Thread Tom Eccles via cfe-commits
@@ -1151,6 +1154,311 @@ struct TargetLoongArch64 : public GenericTarget { return GenericTarget::integerArgumentType(loc, argTy); } + + /// Flatten non-basic types, resulting in an array of types containing only + /// `IntegerType` and `FloatType`. + std::vector flatt

[clang] [flang] [Flang] LoongArch64 support for BIND(C) derived types in mabi=lp64d. (PR #117108)

2024-11-26 Thread Tom Eccles via cfe-commits
@@ -1151,6 +1154,311 @@ struct TargetLoongArch64 : public GenericTarget { return GenericTarget::integerArgumentType(loc, argTy); } + + /// Flatten non-basic types, resulting in an array of types containing only + /// `IntegerType` and `FloatType`. + std::vector flatt

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-19 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. This looks good to me but please don't merge without agreement on this approach from the other reviewers. https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@li

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Tom Eccles via cfe-commits
@@ -490,6 +490,16 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { + StringRef V = A->getVa

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Tom Eccles via cfe-commits
@@ -490,6 +490,16 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { + StringRef V = A->getVa

[clang] [flang] [flang] Support -mabi=vec-extabi and -mabi=vec-default on AIX (PR #113215)

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

[clang] [flang] Revert "[flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv" (PR #113901)

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

[clang] [flang] Revert "[flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv" (PR #113901)

2024-10-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/113901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (PR #110063)

2024-10-28 Thread Tom Eccles via cfe-commits
tblah wrote: @yus3710-fj after this patch we get a 7-10% slowdown for 503.bwaves_r from SPEC2017. I built with `-Ofast -mcpu=native -fuse-ld=lld -flto` As I understood it, the previous patch was supposed to enable your transformation by default, and this one was only supposed to clean up old

[clang] [llvm] [mlir] [OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

2024-10-23 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM. Thanks for the extensive cleanup https://github.com/llvm/llvm-project/pull/112533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [flang] [flang] Support -mabi=vec-extabi and -mabi=vec-default on AIX (PR #113215)

2024-10-22 Thread Tom Eccles via cfe-commits
@@ -203,6 +203,30 @@ void Flang::AddAArch64TargetArgs(const ArgList &Args, } } +void Flang::AddPPCTargetArgs(const ArgList &Args, + ArgStringList &CmdArgs) const { + bool VecExtabi = false; + for (const Arg *A : Args.filtered(options::OPT_mabi_E

[clang] [llvm] [mlir] [OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

2024-10-22 Thread Tom Eccles via cfe-commits
@@ -1171,12 +1179,15 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, // post finalization block that is known to the FiniCB callback. Builder.SetInsertPoint(CancellationBlock); if (ExitCB) -ExitCB(Builder.saveIP()); +if (Error Err = ExitCB(Bu

[clang] [llvm] [mlir] [OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

2024-10-22 Thread Tom Eccles via cfe-commits
@@ -1496,7 +1507,8 @@ IRBuilder<>::InsertPoint OpenMPIRBuilder::createParallel( // Let the caller create the body. assert(BodyGenCB && "Expected body generation callback!"); InsertPointTy CodeGenIP(PRegBodyBB, PRegBodyBB->begin()); - BodyGenCB(InnerAllocaIP, CodeGenIP);

[clang] [flang] [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (PR #110063)

2024-10-21 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks! LGTM https://github.com/llvm/llvm-project/pull/110063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-15 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. This looks good to me, thanks! https://github.com/llvm/llvm-project/pull/110061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][flang] Support -time in both clang and flang (PR #109165)

2024-10-14 Thread Tom Eccles via cfe-commits
@@ -194,11 +197,29 @@ int Compilation::ExecuteCommand(const Command &C, if (LogOnly) return 0; + // We don't use any timers or llvm::TimeGroup's because those are tied into + // the global static timer list which, in principle, could be cleared without + // us knowing

[clang] [flang] [clang][flang] Support -time in both clang and flang (PR #109165)

2024-10-14 Thread Tom Eccles via cfe-commits
@@ -194,11 +197,29 @@ int Compilation::ExecuteCommand(const Command &C, if (LogOnly) return 0; + // We don't use any timers or llvm::TimeGroup's because those are tied into + // the global static timer list which, in principle, could be cleared without + // us knowing

[clang] [flang] [clang][flang] Support -time in both clang and flang (PR #109165)

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

[clang] [flang] [clang][flang] Support -time in both clang and flang (PR #109165)

2024-10-14 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks for this! https://github.com/llvm/llvm-project/pull/109165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Link to libatomic with openmp and rtlib=libgcc (PR #112202)

2024-10-14 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM thanks! https://github.com/llvm/llvm-project/pull/112202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [clang][flang][mlir] Reapply "Support -frecord-command-line option (#102975)" (PR #110132)

2024-10-10 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/110132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023)

2024-10-04 Thread Tom Eccles via cfe-commits
@@ -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 e

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM but if possible please wait for another reviewer https://github.com/llvm/llvm-project/pull/110598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Tom Eccles via cfe-commits
tblah wrote: We discussed this further offline and I am now convinced there could be a valid usecase for this. Some C++ code might use header-only parts of the C++ standard library. Setting `-stdlib=` will effect the include paths clang uses for stdlib when compiling. When flang links the pro

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Tom Eccles via cfe-commits
tblah wrote: If this is completely ignored and does not effect the link line, are you sure the resulting binary actually uses the right c++ library? https://github.com/llvm/llvm-project/pull/110598 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-02 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,48 @@ +// REQUIRES: system-linux tblah wrote: I'm not sure about this test. Usually we would go about testing something like this by running FileCheck on the output of `flang-new -###` to see what is passed to the linker (and that the linker gets cal

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-02 Thread Tom Eccles via cfe-commits
tblah wrote: I don't think it is correct to say that the option was ignored. It may still be read by the compiler driver (which generates the link line). In fact it probably *should* be processed by the compiler driver in order to set the C++ standard library correctly - otherwise you could ju

[clang] [flang] [Flang][Driver][Offload] Support -Xoffload-linker argument in Flang (PR #109907)

2024-09-25 Thread Tom Eccles via cfe-commits
tblah wrote: The CI failures look relevant. The problem isn't immediately apparent to me from the diff (which looks good to me). https://github.com/llvm/llvm-project/pull/109907 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [flang] [Flang][Driver] Enable the -B option (PR #109965)

2024-09-25 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,23 @@ +! Check -B driver option. +! +! Target triple prefix is not detected for -B. +! RUN: %flang %s -### -o %t.o -target i386-unknown-linux \ +! RUN: -B %S/Inputs/B_opt_tree/dir1 -fuse-ld=ld 2>&1 \ +! RUN: | FileCheck --check-prefix=CHECK-B-OPT-TRIPLE %s +! CHEC

[clang] [flang] [Flang][Driver] Enable the -B option (PR #109965)

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

[clang] [flang] [Flang][Driver] Enable the -B option (PR #109965)

2024-09-25 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/109965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Support -fdiagnostics-color (PR #109210)

2024-09-19 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Is `-fdiagnostics-color=auto` too host-environment dependent to test? https://github.com/llvm/llvm-project/pull/109210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [flang] [flang][Driver] Support -nostdlib and -nodefaultlibs (PR #108868)

2024-09-17 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/108868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >