[PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)

2023-10-20 Thread Paul-Antoine Arras
ep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Fri, 20 Oct 2023 12:42:49 +0200 Subject: [PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr) In the context of an OpenMP declare variant directive, arguments of type C_PTR are sometimes recognised as C_PTR in the base f

Re: [PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)

2023-10-26 Thread Paul-Antoine Arras
Hi Tobias, Please see the updated patch attached incorporating your input and details below. On 24/10/2023 18:12, you wrote: On 20.10.23 16:02, Paul-Antoine Arras wrote: gcc/fortran/ChangeLog:   * interface.cc (gfc_compare_types): Return true in this situation. That's

Re: [PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)

2023-10-26 Thread Paul-Antoine Arras
Hi Thomas, On 26/10/2023 18:16, you wrote: Hi! On 2023-10-26T13:24:04+0200, Paul-Antoine Arras wrote: --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90 @@ -0,0 +1,57 @@ +! { dg-do compile } +! { dg-additional-options "-fopenmp" } +[...] --- /dev/null +++ b/gcc

[PATCH] amdgcn: Add instruction patterns for conditional min/max operations

2023-03-01 Thread Paul-Antoine Arras
1cd86b4420d9d42bcde83d0ac52a03a07d4aa819 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Wed, 1 Mar 2023 17:20:21 +0100 Subject: [PATCH] amdgcn: Add instruction patterns for conditional min/max operations gcc/ChangeLog: * config/gcn/gcn-valu.md (3_exec): Add patterns for {s|u}{max|min} in QI, HI and DI

Re: [PATCH] amdgcn: Add instruction patterns for conditional min/max operations

2023-03-03 Thread Paul-Antoine Arras
Le 02/03/2023 à 18:18, Andrew Stubbs a écrit : On 01/03/2023 16:56, Paul-Antoine Arras wrote: This patch introduces instruction patterns for conditional min and max operations (cond_{f|s|u}{max|min}) in the GCN machine description. It also allows the exec register to be saved in SGPRs to avoid

[OG12][PATCH] OpenMP: Fix ICE with OMP metadirectives

2022-09-21 Thread Paul-Antoine Arras
73ecbc2672a5352a08260f7a9d0de6d2c29ea2b6 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Wed, 21 Sep 2022 15:52:56 + Subject: [PATCH] OpenMP: Fix ICE with OMP metadirectives Problem: ending an OpenMP metadirective block with an OMP end statement results in an internal compiler error. Solution: reject invalid end

[committed] MAINTAINERS: Add myself to Write After Approval

2022-09-23 Thread Paul-Antoine Arras
Hello, I just added myself to the Write After Approval section of MAINTAINERS file. -- PAFrom d10308ff618e036d6c3d1a8c491ca4755b257612 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Fri, 23 Sep 2022 10:21:48 + Subject: [PATCH] MAINTAINERS: Add myself to Write After Approval

Re: [OG12][PATCH] OpenMP: Fix ICE with OMP metadirectives

2022-09-28 Thread Paul-Antoine Arras
Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Wed, 21 Sep 2022 15:52:56 + Subject: [PATCH] OpenMP: Fix ICE with OMP metadirectives Problem: ending an OpenMP metadirective block with an OMP end statement results in an internal compiler error. Solution: reject invalid end statements and

[OG12][PATCH] openmp: Fix handling of target constructs in static member

2022-09-13 Thread Paul-Antoine Arras
29.C diff --git gcc/cp/ChangeLog.omp gcc/cp/ChangeLog.omp index 35504f4c92b..c3214f31252 100644 --- gcc/cp/ChangeLog.omp +++ gcc/cp/ChangeLog.omp @@ -1,3 +1,13 @@ +2022-09-09 Paul-Antoine Arras + + Backport from mainline: + 2022-09-07 Jakub Jelinek + + PR c++/106829

[wwwdocs, committed] git: Move current devel/omp/gcc branch to 14

2024-06-28 Thread Paul-Antoine Arras
Committed as debf3885965604c81541a549d531ec450f498058 https://gcc.gnu.org/git.html#general -- PAcommit debf3885965604c81541a549d531ec450f498058 Author: Paul-Antoine Arras Date: Fri Jun 28 12:08:57 2024 +0200 git: Move current devel/omp/gcc branch to 14 diff --git htdocs/git.html htdocs

[PATCH v2 1/8] Fix warnings for tree formats in gfc_error

2024-07-12 Thread Paul-Antoine Arras
This enables proper warnings for formats like %qD. gcc/c-family/ChangeLog: * c-format.cc (gcc_gfc_char_table): Add formats for tree objects. --- gcc/c-family/c-format.cc | 4 1 file changed, 4 insertions(+) diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc index 5bfd

[PATCH v2 6/8] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-07-12 Thread Paul-Antoine Arras
gcc/testsuite/ChangeLog: * c-c++-common/gomp/declare-variant-2.c: Adjust dg-error directives. * c-c++-common/gomp/adjust-args-1.c: New test. * c-c++-common/gomp/adjust-args-2.c: New test. * c-c++-common/gomp/dispatch-1.c: New test. * c-c++-common/gomp/dispat

[PATCH v2 0/8] OpenMP: dispatch + adjust_args support

2024-07-12 Thread Paul-Antoine Arras
. Paul-Antoine Arras (8): Fix warnings for tree formats in gfc_error OpenMP: dispatch + adjust_args tree data structures and front-end interfaces OpenMP: middle-end support for dispatch + adjust_args OpenMP: C front-end support for dispatch + adjust_args OpenMP: C++ front-end support for

[PATCH v2 3/8] OpenMP: middle-end support for dispatch + adjust_args

2024-07-12 Thread Paul-Antoine Arras
This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr` respectively. For `adjust_args`, this mostly consists in emitting a call to `gomp_get_mapped_ptr` for the adequate device. For

[PATCH v2 2/8] OpenMP: dispatch + adjust_args tree data structures and front-end interfaces

2024-07-12 Thread Paul-Antoine Arras
This patch introduces the OMP_DISPATCH tree node, as well as two new clauses `nocontext` and `novariants`. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. It also adds support for new OpenMP con

[PATCH v2 5/8] OpenMP: C++ front-end support for dispatch + adjust_args

2024-07-12 Thread Paul-Antoine Arras
This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised in the corresponding C front end patch for pragmas and attributes. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog:

[PATCH v2 4/8] OpenMP: C front-end support for dispatch + adjust_args

2024-07-12 Thread Paul-Antoine Arras
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_c

[PATCH v2 7/8] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-07-12 Thread Paul-Antoine Arras
This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation units is missing due to PR115271. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext

[PATCH v2 8/8] OpenMP: update documentation for dispatch and adjust_args

2024-07-12 Thread Paul-Antoine Arras
libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 50da248b74d..a2f5897463a 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -294,8 +294,8 @@ T

[PATCH] i386, testsuite: Fix non-Unicode character

2024-07-15 Thread Paul-Antoine Arras
This trivially fixes an incorrectly encoded character in the DejaGnu scan pattern. OK for trunk? -- PA>From 87686fe5589711b90d0b421368747373978f2a39 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Mon, 15 Jul 2024 13:18:01 +0200 Subject: [PATCH] Fix non-Unicode character ---

[PATCH 0/7] OpenMP: dispatch + adjust_args support

2024-05-27 Thread Paul-Antoine Arras
fx90a) GPU. Paul-Antoine Arras (7): OpenMP: dispatch + adjust_args tree data structures and front-end interfaces OpenMP: middle-end support for dispatch + adjust_args OpenMP: C front-end support for dispatch + adjust_args OpenMP: C++ front-end support for dispatch + adjust_args OpenMP:

[PATCH 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-05-27 Thread Paul-Antoine Arras
This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr` respectively. For `adjust_args`, this mostly consists in emitting a call to `gomp_get_mapped_ptr` for the adequate device. For

[PATCH 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-05-27 Thread Paul-Antoine Arras
gcc/testsuite/ChangeLog: * c-c++-common/gomp/declare-variant-2.c: Adjust dg-error directives. * c-c++-common/gomp/adjust-args-1.c: New test. * c-c++-common/gomp/adjust-args-2.c: New test. * c-c++-common/gomp/dispatch-1.c: New test. * c-c++-common/gomp/dispat

[PATCH 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-05-27 Thread Paul-Antoine Arras
This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised in the corresponding C front end patch for pragmas and attributes. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog:

[PATCH 1/7] OpenMP: dispatch + adjust_args tree data structures and front-end interfaces

2024-05-27 Thread Paul-Antoine Arras
This patch introduces the OMP_DISPATCH tree node, as well as two new clauses `nocontext` and `novariants`. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. It also adds support for new OpenMP con

[PATCH 7/7] OpenMP: update documentation for dispatch and adjust_args

2024-05-27 Thread Paul-Antoine Arras
libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 71d62105a20..b72accd0d26 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -294,8 +294,8 @@ T

[PATCH 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-05-27 Thread Paul-Antoine Arras
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_c

[PATCH 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-05-27 Thread Paul-Antoine Arras
This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext clauses. (show_omp_node): Handle EXEC_OMP_DISPATCH. (show_cod

Re: [PATCH 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-05-31 Thread Paul-Antoine Arras
Hi Tobias, Thanks for your comments. Here is an updated patch. On 28/05/2024 09:14, Tobias Burnus wrote: Paul-Antoine Arras: +  if (n->sym->ts.type != BT_DERIVED +  || !n->sym->ts.u.derived->ts.is_iso_c) +    { +  gfc_error ("argum

Re: [PATCH v3 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-08-20 Thread Paul-Antoine Arras
Hi Tobias, Thanks for the review. Please find attached an updated patch following your comments. Since further adjustments to other patches of the series were required, I'll post them shortly. See also my replies below. On 09/08/2024 13:51, Tobias Burnus wrote: Paul-Antoine Arras

Re: [PATCH v3 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-08-21 Thread Paul-Antoine Arras
Here is an updated version following Tobias's review on the ME patch. The differences compared to the previous version are: * updated DejaGnu patterns * added testcase dispatch-8.c -- PA commit 533f2693680f109837f03cda2e123b155bbb5c60 Author: Paul-Antoine Arras Date: Fri May 24 19:04:35

Re: [PATCH v3 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-08-21 Thread Paul-Antoine Arras
Paul-Antoine Arras Date: Fri May 24 19:13:50 2024 +0200 OpenMP: Fortran front-end support for dispatch + adjust_args This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation uni

[PATCH v3 1/7] OpenMP: dispatch + adjust_args tree data structures and front-end interfaces

2024-08-07 Thread Paul-Antoine Arras
This patch introduces the OMP_DISPATCH tree node, as well as two new clauses `nocontext` and `novariants`. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. gcc/ChangeLog: * builtin-types

[PATCH v3 0/7] OpenMP: dispatch + adjust_args support

2024-08-07 Thread Paul-Antoine Arras
-Antoine Arras (7): OpenMP: dispatch + adjust_args tree data structures and front-end interfaces OpenMP: middle-end support for dispatch + adjust_args OpenMP: C front-end support for dispatch + adjust_args OpenMP: C++ front-end support for dispatch + adjust_args OpenMP: common C/C++ testcases

[PATCH v3 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-08-07 Thread Paul-Antoine Arras
This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr` respectively. For `adjust_args`, this mostly consists in emitting a call to `gomp_get_mapped_ptr` for the adequate device. For

[PATCH v3 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-08-07 Thread Paul-Antoine Arras
gcc/testsuite/ChangeLog: * c-c++-common/gomp/declare-variant-2.c: Adjust dg-error directives. * c-c++-common/gomp/adjust-args-1.c: New test. * c-c++-common/gomp/adjust-args-2.c: New test. * c-c++-common/gomp/dispatch-1.c: New test. * c-c++-common/gomp/dispat

[PATCH v3 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-08-07 Thread Paul-Antoine Arras
This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised in the corresponding C front end patch for pragmas and attributes. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog:

[PATCH v3 7/7] OpenMP: update documentation for dispatch and adjust_args

2024-08-07 Thread Paul-Antoine Arras
libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 07cd75124b0..b35424c047a 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -294,8 +294,8 @@ T

[PATCH v3 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-08-07 Thread Paul-Antoine Arras
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_c

[PATCH v3 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-08-07 Thread Paul-Antoine Arras
This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation units is missing due to PR115271. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext

[PATCH] amdgcn: Add instruction pattern for conditional shift operations

2023-02-01 Thread Paul-Antoine Arras
This patch introduces an instruction pattern for conditional shift operations (cond_{ashl|ashr|lshr}) in the GCN machine description. Tested on GCN3 Fiji gfx803. OK to commit? -- PA From e9c974670e8d37f725098eea97e22be5e2e9fd21 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Wed, 1 Feb

[PATCH] amdgcn: Support AMD-specific 'isa' traits in OpenMP context selectors

2022-11-29 Thread Paul-Antoine Arras
Is it OK for mainline? Thanks, -- PAFrom 2523122f7fff806aca7f7f03109668064969aa2d Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Tue, 29 Nov 2022 16:22:07 +0100 Subject: [PATCH] amdgcn: Support AMD-specific 'isa' traits in OpenMP context selectors Add support for gfx803 as a

[PATCH][OG12] amdgcn: Support AMD-specific 'isa' and 'arch' traits in OpenMP context selectors

2022-11-30 Thread Paul-Antoine Arras
h is closely related to https://gcc.gnu.org/r13-4403-g1fd508744eccda but cannot be committed to mainline because metadirectives and dynamic context selectors have not landed there yet. Can this be committed to OG12? Thanks,From 88522107dd39ba3ff8465cf688fe4438fa3b77b4 Mon Sep 17 00:00:00 2001 From:

Re: [PATCH][OG12] amdgcn: Support AMD-specific 'isa' and 'arch' traits in OpenMP context selectors

2022-12-01 Thread Paul-Antoine Arras
dif Okay for gfx908 and gfx90a, but is there any way of distinguishing between 'gfx900' and 'gfx906' ISAs? I don't think these are mutually compatible. Since I did not find any existing builtin to check the exact ISA, I added all of them for consistency. Let me kn

[PATCH] amdgcn: Add preprocessor builtins for every processor type

2022-12-01 Thread Paul-Antoine Arras
Hi Andrew, all, On 01/12/2022 13:45, Andrew Stubbs wrote: On 01/12/2022 11:10, Paul-Antoine Arras wrote: +  if (TARGET_FIJI) \ +    builtin_define ("__FIJI__");   \ +   

Re: [PATCH][OG12] amdgcn: Support AMD-specific 'isa' and 'arch' traits in OpenMP context selectors

2022-12-01 Thread Paul-Antoine Arras
previous patch. Once https://gcc.gnu.org/r13-4446-ge41b243302e996 is backported, is it OK for OG12? Thanks, -- PAFrom 494a815af459b13da6fe9bf5a84b94d4b1f94915 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Wed, 30 Nov 2022 14:52:55 +0100 Subject: [PATCH] amdgcn: Support AMD-specific

Re: [PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-23 Thread Paul-Antoine Arras
Here is an updated patch following these comments. On 09/10/2024 19:15, Tobias Burnus wrote: First comments; I need to have a deeper, but now I need fetch some victuals. Paul-Antoine Arras wrote: This patch adds support to the C front-end to parse the `dispatch` construct and the

Re: [PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-10-22 Thread Paul-Antoine Arras
Hi Tobias, Thanks for your thorough review. Please find attached a revised patch. On 09/10/2024 14:55, Tobias Burnus wrote: Paul-Antoine Arras wrote: This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in

Re: [PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-30 Thread Paul-Antoine Arras
On 24/10/2024 13:42, Tobias Burnus wrote: Hi, some more comments: Paul-Antoine Arras wrote: Here is an updated patch following these comments. gcc/testsuite/ChangeLog: * gcc.dg/gomp/adjust-args-1.c: New test. * gcc.dg/gomp/dispatch-1.c: New test. The

Re: [PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-30 Thread Paul-Antoine Arras
On 30/10/2024 15:08, Tobias Burnus wrote: I still need to look at 4/7 (C++) and 5/7 (tests for C and C++) [either before after you posted the new version]. I sent a revised C++ patch a few moments ago. * * * However, this 3/7 patch LGTM 🙂 One comment: For the < C23 testcase, can you add, e.

Re: [PATCH v4 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-10-30 Thread Paul-Antoine Arras
On 24/10/2024 16:10, Tobias Burnus wrote: Hi PA; only playing around quickly and glancing at the patch; I need to have a real look at this later. Paul-Antoine Arras: This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised

Re: [PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-10-23 Thread Paul-Antoine Arras
/7 or later of the series as it requires a parser and, as written/file location, requires both C and C+ +, unless a skip for C is added. Moved the testcase to 5/7. Will post the updated patch later. Thanks, -- PAcommit 6265c755697bba629fce4b27b8f1800ea1e313fb Author: Paul-Antoine Arras Date: Fr

Re: [PATCH v4 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-11-12 Thread Paul-Antoine Arras
TM (assuming that you have a testcase for it). The testcase is gcc/testsuite/g++.dg/gomp/dispatch-4.C, included in v4.1-0004-OpenMP-C-front-end-support-for-dispatch-adjust_ar.patch... but I forgot to update the ChangeLog. * * * Regarding C++: Paul-Antoine Arras wrote: In C++,

Re: [PATCH v4 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-11-13 Thread Paul-Antoine Arras
Here is an updated version of the patch following earlier reviews in the series. -- PAcommit 8f67de476decf151f853d68eb26223200535cc57 Author: Paul-Antoine Arras Date: Fri May 24 19:04:35 2024 +0200 OpenMP: common C/C++ testcases for dispatch + adjust_args gcc/testsuite/ChangeLog

[PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_c

[PATCH v4 1/7] OpenMP: dispatch + adjust_args tree data structures and front-end interfaces

2024-10-02 Thread Paul-Antoine Arras
This patch introduces the OMP_DISPATCH tree node, as well as two new clauses `nocontext` and `novariants`. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. gcc/ChangeLog: * builtin-types

[PATCH v4 0/7] OpenMP: dispatch + adjust_args support

2024-10-02 Thread Paul-Antoine Arras
ingle function call we are interested in is sandwiched in a sequence of pre- and post-call statements, or when the same function is call several times within the dispatch body. Paul-Antoine Arras (7): OpenMP: dispatch + adjust_args tree data structures and front-end interfaces OpenMP: m

[PATCH v4 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
gcc/testsuite/ChangeLog: * c-c++-common/gomp/declare-variant-2.c: Adjust dg-error directives. * c-c++-common/gomp/adjust-args-1.c: New test. * c-c++-common/gomp/adjust-args-2.c: New test. * c-c++-common/gomp/dispatch-1.c: New test. * c-c++-common/gomp/dispat

[PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation units is missing due to PR115271. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext

[PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr` respectively. For `adjust_args`, this mostly consists in emitting a call to `gomp_get_mapped_ptr` for the adequate device. For

[PATCH v4 7/7] OpenMP: update documentation for dispatch and adjust_args

2024-10-02 Thread Paul-Antoine Arras
libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index c6464ece32e..7026f32f867 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -294,8 +294,8 @@ T

[PATCH v4 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised in the corresponding C front end patch for pragmas and attributes. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog:

[PATCH] Do not call cp_parser_omp_dispatch directly in cp_parser_pragma

2025-01-06 Thread Paul-Antoine Arras
This is a followup to ed49709acda OpenMP: C++ front-end support for dispatch + adjust_args. The call to cp_parser_omp_dispatch only belongs in cp_parser_omp_construct. In cp_parser_pragma, handle PRAGMA_OMP_DISPATCH by calling cp_parser_omp_construct. gcc/cp/ChangeLog: * parser.cc (cp_pa

Re: [PATCH] Only apply adjust_args in OpenMP dispatch if variant substitution occurs

2025-01-06 Thread Paul-Antoine Arras
Apologies, I forgot to add the testcase. Please find attached an updated patch. On 06/01/2025 17:12, Paul-Antoine Arras wrote: This is a followup to 084ea8ad584 OpenMP: middle-end support for dispatch + adjust_args. This patch fixes a bug that caused arguments in an OpenMP dispatch call to be

[PATCH] Only apply adjust_args in OpenMP dispatch if variant substitution occurs

2025-01-06 Thread Paul-Antoine Arras
This is a followup to 084ea8ad584 OpenMP: middle-end support for dispatch + adjust_args. This patch fixes a bug that caused arguments in an OpenMP dispatch call to be modified even when no variant substitution occurred. gcc/ChangeLog: * gimplify.cc (gimplify_call_expr): Create variable

[PATCH] Accept commas between clauses in OpenMP declare variant

2025-01-06 Thread Paul-Antoine Arras
Add support to the Fortran parser for the new OpenMP syntax that allows a comma after the directive name and between clauses of declare variant. The C and C++ parsers already support this syntax so only a new test is added. gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_declare_variant

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-12-30 Thread Paul-Antoine Arras
On 27/12/2024 19:52, Paul-Antoine Arras wrote: On 23/12/2024 21:04, Tobias Burnus wrote: For adjust-args-10.f90, I wonder whether it is sufficient as compile- time only or whether it makes more sense to have a "dg-do run" to check that type(C_ptr) value vs. not-value works. I think

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-12-27 Thread Paul-Antoine Arras
Hi Tobias, On 23/12/2024 21:04, Tobias Burnus wrote: Paul-Antoine Arras wrote: Replying to your last two messages here and attaching revised patches. Regarding the C++ and ME patches: ==> 0003-C-fix.patch <== Subject: [PATCH 3/4] C++ fix ==> 0004-ME-fixes.patch <== Subject: [P

[PATCH] OpenMP/Fortran: Add missing pop_state in parse_omp_dispatch

2025-01-31 Thread Paul-Antoine Arras
When the ST_NONE case is taken, the function returns immediately. Not calling pop_state causes a dangling pointer. gcc/fortran/ChangeLog: * parse.cc (parse_omp_dispatch): Add missing pop_state. --- gcc/fortran/parse.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] OpenMP/Fortran: Add missing pop_state in parse_omp_dispatch

2025-01-31 Thread Paul-Antoine Arras
Pushed to master as obvious. This should fix PR118714. On 31/01/2025 11:46, Paul-Antoine Arras wrote: When the ST_NONE case is taken, the function returns immediately. Not calling pop_state causes a dangling pointer. gcc/fortran/ChangeLog: * parse.cc (parse_omp_dispatch): Add missing

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-12-16 Thread Paul-Antoine Arras
Hi Tobias, See the revised patch attached and my comments below. On 15/11/2024 14:59, Tobias Burnus wrote: Hi, Paul-Antoine Arras wrote: This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation

Re: [PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-12-06 Thread Paul-Antoine Arras
Hi Tobias, Thanks for your thorough review. On 09/10/2024 14:55, Tobias Burnus wrote: Paul-Antoine Arras wrote: This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr

Re: [PATCH] Accept commas between clauses in OpenMP declare variant

2025-01-13 Thread Paul-Antoine Arras
Hi Tobias, Here are an updated patch and a few questions. On 07/01/2025 13:18, Tobias Burnus wrote: Paul-Antoine Arras: Add support to the Fortran parser for the new OpenMP syntax that allows a comma after the directive name and between clauses of declare variant. The C and C++ parsers

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2025-01-13 Thread Paul-Antoine Arras
On 13/01/2025 14:57, Tobias Burnus wrote: Hi PA, Paul-Antoine Arras wrote: Here is an updated patch following your suggestion. Thanks. It is not clear whether you are just waiting for test result or not before committing it as obvious. Thus, just in case: LGTM. Thanks, Tobias Thanks

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2025-01-13 Thread Paul-Antoine Arras
Hi Thomas, On 08/01/2025 10:04, Thomas Schwinge wrote: Hi Paul-Antoine! On 2024-12-16T19:35:01+0100, Paul-Antoine Arras wrote: On 15/11/2024 14:59, Tobias Burnus wrote: Paul-Antoine Arras wrote: This patch adds support for the `dispatch` construct and the `adjust_args` clause to the

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2025-01-13 Thread Paul-Antoine Arras
Hi Tobias, On 13/01/2025 13:24, Tobias Burnus wrote: Hi PA, Paul-Antoine Arras wrote: Hi Thomas, Added libgomp/testsuite/libgomp.fortran/dispatch-1.f90. I see this new test case FAIL (execution test SIGSEGV) for most (but not all) offloading configurations, both GCN and nvptx: +PASS

Re: [PATCH] Accept commas between clauses in OpenMP declare variant

2025-01-13 Thread Paul-Antoine Arras
On 13/01/2025 16:51, Tobias Burnus wrote: Hi PA, Paul-Antoine Arras wrote: I am not sure I am getting that part. Is this what you are suggesting? Yes, something like that, but not quite, as you found out. I think we need something like the following (untested): diff --git gcc/fortran

Re: [PATCH v4 7/7] OpenMP: update documentation for dispatch and adjust_args

2025-01-03 Thread Paul-Antoine Arras
Committing this last patch in the set as obvious (and approved off list). On 02/10/2024 18:55, Paul-Antoine Arras wrote: libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp

Re: [PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-12-23 Thread Paul-Antoine Arras
g an -fdump-tree-gimple + scan test probably won't harm, as not everyone has a GPU and we might implement map as selfmap on APUs). This is actually not specific to the Fortran FE. So I had to modify the middle end and the C++ parser as well. See attached pactches. Otherwise LGTM. Tobias

Re: [PATCH] Do not call cp_parser_omp_dispatch directly in cp_parser_pragma

2025-01-10 Thread Paul-Antoine Arras
Hi Tobias, On 07/01/2025 12:13, Tobias Burnus wrote: Paul-Antoine Arras wrote: This is a followup to ed49709acda OpenMP: C++ front-end support for dispatch + adjust_args. The call to cp_parser_omp_dispatch only belongs in cp_parser_omp_construct. In cp_parser_pragma, handle

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-23 Thread Paul-Antoine Arras
actual rather than generic types. * Renamed 'nowait' argument into 'flags' to allow for future extension. * Added comments. * Fixed style and formatting. -- PAFrom 971aff0b218e6dfc0215d3fd04bfa24aded61532 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Thu, 13 Mar 2025 17

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-24 Thread Paul-Antoine Arras
On 21/03/2025 20:17, Sandra Loosemore wrote: On 3/21/25 11:35, Paul-Antoine Arras wrote: Thanks Sandra and Jakub for your comments. Here is attached an updated version of the patch: * Removed special case for n==1, now use an array even when only one interop object is passed. * Updated scan

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-24 Thread Paul-Antoine Arras
Hi Thomas, On 24/03/2025 13:47, Thomas Schwinge wrote: On 2025-03-21T18:35:57+0100, Paul-Antoine Arras wrote: --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/interop-5.f90 @@ -0,0 +1,21 @@ +! { dg-additional-options "-fdump-tree-omplower" } + +subroutine sub1 (a1, a2, a3, a

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-24 Thread Paul-Antoine Arras
Here is a patch that encompasses the modifications requested by Sandra and Thomas, as well as a fix for 32-bit pointers. OK for trunk? -- PAcommit b1b634d5d3c35682b65edacecf7a4749221f5728 Author: Paul-Antoine Arras Date: Mon Mar 24 15:53:36 2025 +0100 OpenMP: interop - make arrays const

[PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-04-05 Thread Paul-Antoine Arras
This patch partially enables use of the OpenMP interop construct by adding middle end support, mostly in the omplower pass, and in the target-independent part of the libgomp runtime. It follows up on previous patches for C, C++ and Fortran front ends support. The full interop feature requires anoth

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-25 Thread Paul-Antoine Arras
On 24/03/2025 21:17, Sandra Loosemore wrote: On 3/24/25 08:20, Paul-Antoine Arras wrote: On 21/03/2025 20:17, Sandra Loosemore wrote: Does the attached patch reflect what you have in mind? diff --git libgomp/libgomp_g.h libgomp/libgomp_g.h index 8993ec610fb..274f4937680 100644 --- libgomp

Re: [PATCH] OpenMP: 'interop' construct - add ME support + target-independent libgomp

2025-03-27 Thread Paul-Antoine Arras
On 25/03/2025 18:55, Sandra Loosemore wrote: On 3/25/25 09:25, Paul-Antoine Arras wrote: On 24/03/2025 21:17, Sandra Loosemore wrote: [snip] Besides, I am not sure how to encode complex types like (**const *). Does that require creating new definitions in gcc/builtin-types.def and gcc/fortran

[PATCH] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100]

2025-03-27 Thread Paul-Antoine Arras
This pattern enables the combine pass to merge a vec_duplicate into a plus-mult or minus-mult RTL instruction. Before this patch, we have two instructions, e.g.: vfmv.v.fv6,fa0 vfmadd.vv v9,v6,v7 After, we get only one: vfmadd.vf v9,fa0,v7 On SPEC2017's 503.bwaves_r, de

Re: [PATCH] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100]

2025-04-16 Thread Paul-Antoine Arras
ecution time gains. The vector-scalar is only faster by 0.33% on average over 3 iterations. Thanks, -- PAcommit b0f1dbf8b4ad12c0eff459d0bf6b3d9c466fd5ad Author: Paul-Antoine Arras Date: Tue Feb 25 16:38:54 2025 +0100 RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100]