From: Sandra Loosemore <sandra@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <kcy@codesourcery.com>, <tobias@codesourcery.com>, <jakub@redhat.com>
Subject: [PATCH 0/8] OpenMP: Implement metadirective support
Date: Sat, 6 Jan 2024 11:52:48 -0700 [thread overview]
Message-ID: <20240106185257.126445-1-sandra@codesourcery.com> (raw)
This patch set adds support for metadirectives and dynamic selectors
in metadirectives. To give credit where it's due, this is primarily
Kwok's work, originally posted 2+ years ago (and WIP for some time
before that):
https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586600.html
There's also currently an improved version of those patches on the
OG13 branch, along with several followup bug fixes contributed by
others.
My contributions have been collecting, rebasing, and refactoring all
the patches, adding the missing attribute syntax and template support
to the C++ front end, fixing more bugs, adding documentation, and
making some improvements to the internal engineering aspect of the
code.
Although the original patches were posted long ago, I suspect it is
now too late in the release cycle for this feature to make it into GCC
14, although it would certainly make users happy if it could be
squeezed in. Another concern is that I'm facing some short-term
disruptions in my ability to continue work on this and I need to at
least publish the current patches so they don't get lost in the
shuffle. Plus, if this patch set doesn't make it into GCC 14, it will
still be useful as a better starting point for OG14 than the patch set
currently on OG13.
In terms of what is still missing:
- Dynamic context selectors are currently supported only by
metadirective and not declare variant.
- The C and C++ front ends attempt to do early resolution of
metadirectives at parse time, but the Fortran front end does not do
that yet.
- IIUC the construct selector set is supposed to allow you to specify
the name of any OpenMP construct, but it only recognizes a small subset.
- Needs more test cases. (Everything always needs more test cases.)
- Other unimplemented features beyond what was specified in OpenMP 5.1???
BTW, I'm aware that there are some open Bugzilla issues relating to
the OG13 implementation of metadirectives, at least PRs 112779,
107067, and 106730, although I haven't investigated or worked on any
of those directly. I do know that at least items (a) and (h) from PR
112779 have been fixed in this patch set, though.
Anyway, I think it would be reasonable to do the missing features and
bug fixes and follow-up patches rather than continuing to sit on the
entire patch set until it's complete and perfect in every way. :-)
-Sandra
Kwok Cheung Yeung (7):
OpenMP: metadirective tree data structures and front-end interfaces
OpenMP: middle-end support for metadirectives
libgomp: runtime support for target_device selector
OpenMP: C front end support for metadirectives
OpenMP: C++ front-end support for metadirectives
OpenMP: common c/c++ testcases for metadirectives
OpenMP: Fortran front-end support for metadirectives.
Sandra Loosemore (1):
OpenMP: Update documentation of metadirective implementation status.
gcc/Makefile.in | 2 +-
gcc/builtin-types.def | 2 +
gcc/c-family/c-common.h | 4 +-
gcc/c-family/c-gimplify.cc | 27 +
gcc/c-family/c-omp.cc | 60 +-
gcc/c-family/c-pragma.cc | 1 +
gcc/c-family/c-pragma.h | 1 +
gcc/c/c-parser.cc | 493 ++++++++++++++-
gcc/cgraph.h | 3 +
gcc/cgraphclones.cc | 1 +
gcc/cp/decl.cc | 2 +-
gcc/cp/parser.cc | 526 +++++++++++++++-
gcc/cp/parser.h | 7 +
gcc/cp/pt.cc | 118 ++++
gcc/doc/generic.texi | 32 +
gcc/fortran/decl.cc | 29 +
gcc/fortran/dump-parse-tree.cc | 21 +
gcc/fortran/gfortran.h | 24 +-
gcc/fortran/io.cc | 2 +-
gcc/fortran/match.h | 2 +
gcc/fortran/openmp.cc | 265 +++++++-
gcc/fortran/parse.cc | 571 +++++++++++-------
gcc/fortran/parse.h | 8 +-
gcc/fortran/resolve.cc | 6 +
gcc/fortran/st.cc | 4 +
gcc/fortran/symbol.cc | 25 +-
gcc/fortran/trans-decl.cc | 5 +-
gcc/fortran/trans-openmp.cc | 243 +++++---
gcc/fortran/trans-stmt.h | 1 +
gcc/fortran/trans.cc | 1 +
gcc/fortran/types.def | 2 +
gcc/gimple-low.cc | 36 ++
gcc/gimple-pretty-print.cc | 64 ++
gcc/gimple-streamer-in.cc | 10 +
gcc/gimple-streamer-out.cc | 6 +
gcc/gimple-walk.cc | 28 +
gcc/gimple.cc | 35 ++
gcc/gimple.def | 7 +
gcc/gimple.h | 100 ++-
gcc/gimplify.cc | 184 ++++++
gcc/gsstruct.def | 2 +
gcc/lto-cgraph.cc | 2 +
gcc/omp-builtins.def | 3 +
gcc/omp-expand.cc | 30 +
gcc/omp-general.cc | 359 ++++++++++-
gcc/omp-general.h | 32 +-
gcc/omp-low.cc | 80 +++
gcc/omp-offload.cc | 105 +++-
gcc/omp-simd-clone.cc | 1 +
.../c-c++-common/gomp/metadirective-1.c | 52 ++
.../c-c++-common/gomp/metadirective-2.c | 74 +++
.../c-c++-common/gomp/metadirective-3.c | 31 +
.../c-c++-common/gomp/metadirective-4.c | 40 ++
.../c-c++-common/gomp/metadirective-5.c | 24 +
.../c-c++-common/gomp/metadirective-6.c | 31 +
.../c-c++-common/gomp/metadirective-7.c | 31 +
.../c-c++-common/gomp/metadirective-8.c | 16 +
.../gomp/metadirective-construct.c | 177 ++++++
.../c-c++-common/gomp/metadirective-device.c | 147 +++++
.../gomp/metadirective-no-score.c | 95 +++
.../gomp/metadirective-target-device.c | 147 +++++
.../g++.dg/gomp/attrs-metadirective-1.C | 40 ++
.../g++.dg/gomp/attrs-metadirective-2.C | 74 +++
.../g++.dg/gomp/attrs-metadirective-3.C | 31 +
.../g++.dg/gomp/attrs-metadirective-4.C | 41 ++
.../g++.dg/gomp/attrs-metadirective-5.C | 24 +
.../g++.dg/gomp/attrs-metadirective-6.C | 31 +
.../g++.dg/gomp/attrs-metadirective-7.C | 31 +
.../g++.dg/gomp/attrs-metadirective-8.C | 16 +
gcc/testsuite/gcc.dg/gomp/metadirective-1.c | 15 +
.../gfortran.dg/gomp/metadirective-1.f90 | 55 ++
.../gfortran.dg/gomp/metadirective-10.f90 | 40 ++
.../gfortran.dg/gomp/metadirective-11.f90 | 33 +
.../gfortran.dg/gomp/metadirective-2.f90 | 62 ++
.../gfortran.dg/gomp/metadirective-3.f90 | 34 ++
.../gfortran.dg/gomp/metadirective-4.f90 | 39 ++
.../gfortran.dg/gomp/metadirective-5.f90 | 30 +
.../gfortran.dg/gomp/metadirective-6.f90 | 31 +
.../gfortran.dg/gomp/metadirective-7.f90 | 36 ++
.../gfortran.dg/gomp/metadirective-8.f90 | 22 +
.../gfortran.dg/gomp/metadirective-9.f90 | 30 +
.../gomp/metadirective-construct.f90 | 260 ++++++++
.../gomp/metadirective-no-score.f90 | 122 ++++
gcc/testsuite/gfortran.dg/gomp/pure-1.f90 | 7 +
gcc/testsuite/gfortran.dg/gomp/pure-2.f90 | 8 -
gcc/tree-cfg.cc | 24 +
gcc/tree-inline.cc | 39 ++
gcc/tree-pretty-print.cc | 36 +-
gcc/tree-pretty-print.h | 2 +
gcc/tree-ssa-operands.cc | 17 +
gcc/tree.def | 6 +
gcc/tree.h | 3 +
include/cuda/cuda.h | 2 +
libgomp/Makefile.am | 2 +-
libgomp/Makefile.in | 5 +-
libgomp/config/gcn/selector.c | 57 ++
libgomp/config/linux/selector.c | 43 ++
libgomp/config/linux/x86/selector.c | 325 ++++++++++
libgomp/config/nvptx/selector.c | 65 ++
libgomp/libgomp-plugin.h | 2 +
libgomp/libgomp.h | 1 +
libgomp/libgomp.map | 1 +
libgomp/libgomp.texi | 15 +-
libgomp/libgomp_g.h | 8 +
libgomp/oacc-host.c | 11 +
libgomp/plugin/plugin-gcn.c | 14 +
libgomp/plugin/plugin-nvptx.c | 45 ++
libgomp/selector.c | 36 ++
libgomp/target.c | 38 ++
.../libgomp.c++/metadirective-template-1.C | 37 ++
.../libgomp.c++/metadirective-template-2.C | 41 ++
.../libgomp.c++/metadirective-template-3.C | 41 ++
.../libgomp.c-c++-common/metadirective-1.c | 35 ++
.../libgomp.c-c++-common/metadirective-2.c | 41 ++
.../libgomp.c-c++-common/metadirective-3.c | 34 ++
.../libgomp.c-c++-common/metadirective-4.c | 52 ++
.../libgomp.c-c++-common/metadirective-5.c | 46 ++
.../libgomp.fortran/metadirective-1.f90 | 61 ++
.../libgomp.fortran/metadirective-2.f90 | 40 ++
.../libgomp.fortran/metadirective-3.f90 | 29 +
.../libgomp.fortran/metadirective-4.f90 | 46 ++
.../libgomp.fortran/metadirective-5.f90 | 44 ++
.../libgomp.fortran/metadirective-6.f90 | 58 ++
123 files changed, 6528 insertions(+), 423 deletions(-)
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-1.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-2.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-3.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-4.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-5.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-6.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-7.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-8.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-construct.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-device.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-no-score.c
create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-target-device.c
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-1.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-2.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-3.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-4.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-5.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-6.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-7.C
create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-8.C
create mode 100644 gcc/testsuite/gcc.dg/gomp/metadirective-1.c
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-1.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-10.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-11.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-2.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-4.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-5.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-6.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-7.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-8.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-9.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-construct.f90
create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-no-score.f90
create mode 100644 libgomp/config/gcn/selector.c
create mode 100644 libgomp/config/linux/selector.c
create mode 100644 libgomp/config/linux/x86/selector.c
create mode 100644 libgomp/config/nvptx/selector.c
create mode 100644 libgomp/selector.c
create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-1.C
create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-2.C
create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-3.C
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-4.c
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-1.f90
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-2.f90
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-3.f90
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-4.f90
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-5.f90
create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-6.f90
--
2.31.1
next reply other threads:[~2024-01-06 18:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-06 18:52 Sandra Loosemore [this message]
2024-01-06 18:52 ` [PATCH 1/8] OpenMP: metadirective tree data structures and front-end interfaces Sandra Loosemore
2024-01-06 19:45 ` Tobias Burnus
2024-01-07 12:18 ` Tobias Burnus
2024-01-06 18:52 ` [PATCH 2/8] OpenMP: middle-end support for metadirectives Sandra Loosemore
2024-01-06 18:52 ` [PATCH 3/8] libgomp: runtime support for target_device selector Sandra Loosemore
2024-01-06 22:44 ` Tobias Burnus
2024-01-07 11:48 ` Tobias Burnus
2024-01-06 18:52 ` [PATCH 4/8] OpenMP: C front end support for metadirectives Sandra Loosemore
2024-01-06 18:52 ` [PATCH 5/8] OpenMP: C++ front-end " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 6/8] OpenMP: common c/c++ testcases " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 7/8] OpenMP: Fortran front-end support " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 8/8] OpenMP: Update documentation of metadirective implementation status Sandra Loosemore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240106185257.126445-1-sandra@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=kcy@codesourcery.com \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).