public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <jakub@redhat.com>
Subject: [PATCH V2 0/5] OpenMP: support for imperfectly-nested loops
Date: Sun, 23 Jul 2023 16:15:16 -0600	[thread overview]
Message-ID: <20230723221521.3739463-1-sandra@codesourcery.com> (raw)

Here is the latest version of my imperfectly-nested loops patches.
Compared to the initial version I'd posted in April

https://gcc.gnu.org/pipermail/gcc-patches/2023-April/617103.html

this version includes many minor cosmetic fixes suggested by Jakub in
his initial review (also present in the version I committed to the
OG13 branch last month), many new test cases to cover various corner
cases, and code fixes so that C and C++ at least behave consistently
even if the spec is unclear.  The most intrusive of those fixes is
that I couldn't figure out how to make jumping between different
structured blocks of intervening code in the same OMP loop construct
produce errors without introducing new GENERIC and GIMPLE data
structures to represent a structured block without any other
associated OpenMP semantics; that's now part 1 of the patch series.

There are a few things from the review comments I haven't done anything
about:

* I left omp-api.h alone because the Fortran front end needs those
  declarations without everything else in omp-general.h.

* I didn't think I ought to be speculatively implementing extensions
  like allowing "do { ... } while (0);" in intervening code.  If it's
  really important for supporting macros, I suppose it will make it
  into a future version of the OpenMP spec.

* I didn't understand the comment about needing to add "#pragma omp
  ordered doacross(source) and sink" to the testcase for errors with
  the "ordered" clause.  Isn't that only for cross-iteration
  data dependencies?  There aren't any in that loop.  Also note that some
  of my new corner-case tests use the "ordered" clause to trigger an
  error to check that things are being correctly parsed as intervening
  code, so if there is something really bogus there that must be fixed,
  it now affects other test cases as well.

* Likewise I didn't know what to do with coming up with a better
  testcase for "scan".  I could not find an existing testcase with nested
  loops that I could just add intervening code to, and when I made
  another attempt to write a new one from scratch I quickly realized I
  couldn't do much better than the existing one, which Tobias had
  originally helped me with.

-Sandra


Sandra Loosemore (5):
  OpenMP: Add OMP_STRUCTURED_BLOCK and GIMPLE_OMP_STRUCTURED_BLOCK.
  OpenMP:  C front end support for imperfectly-nested loops
  OpenMP: C++ support for imperfectly-nested loops
  OpenMP: New C/C++ testcases for imperfectly nested loops.
  OpenMP: Fortran support for imperfectly-nested loops

 gcc/c-family/c-common.h                       |    1 +
 gcc/c-family/c-omp.cc                         |  151 ++
 gcc/c/c-parser.cc                             |  860 +++++++----
 gcc/cp/constexpr.cc                           |    1 +
 gcc/cp/cp-tree.h                              |    2 +-
 gcc/cp/parser.cc                              | 1315 ++++++++++++-----
 gcc/cp/parser.h                               |    3 +
 gcc/cp/pt.cc                                  |    4 +-
 gcc/cp/semantics.cc                           |  117 +-
 gcc/doc/generic.texi                          |   14 +
 gcc/doc/gimple.texi                           |   19 +
 gcc/fortran/gfortran.h                        |    3 +
 gcc/fortran/openmp.cc                         |  765 ++++++++--
 gcc/fortran/trans-stmt.cc                     |    7 +-
 gcc/gimple-low.cc                             |    5 +
 gcc/gimple-pretty-print.cc                    |    6 +-
 gcc/gimple-walk.cc                            |    1 +
 gcc/gimple.cc                                 |   15 +
 gcc/gimple.def                                |    5 +
 gcc/gimple.h                                  |    3 +
 gcc/gimplify.cc                               |    6 +
 gcc/omp-api.h                                 |   32 +
 gcc/omp-expand.cc                             |    5 +
 gcc/omp-general.cc                            |  134 ++
 gcc/omp-general.h                             |    1 +
 gcc/omp-low.cc                                |  140 +-
 gcc/testsuite/c-c++-common/goacc/collapse-1.c |   16 +-
 gcc/testsuite/c-c++-common/goacc/tile-2.c     |    4 +-
 .../c-c++-common/gomp/imperfect-attributes.c  |   81 +
 .../c-c++-common/gomp/imperfect-badloops.c    |   50 +
 .../c-c++-common/gomp/imperfect-blocks.c      |   75 +
 .../c-c++-common/gomp/imperfect-extension.c   |   55 +
 .../c-c++-common/gomp/imperfect-gotos.c       |  174 +++
 .../gomp/imperfect-invalid-scope.c            |   77 +
 .../c-c++-common/gomp/imperfect-labels.c      |   85 ++
 .../gomp/imperfect-legacy-syntax.c            |   44 +
 .../c-c++-common/gomp/imperfect-pragmas.c     |   85 ++
 gcc/testsuite/c-c++-common/gomp/imperfect1.c  |   38 +
 gcc/testsuite/c-c++-common/gomp/imperfect2.c  |   34 +
 gcc/testsuite/c-c++-common/gomp/imperfect3.c  |   33 +
 gcc/testsuite/c-c++-common/gomp/imperfect4.c  |   33 +
 gcc/testsuite/c-c++-common/gomp/imperfect5.c  |   57 +
 gcc/testsuite/g++.dg/gomp/attrs-imperfect1.C  |   38 +
 gcc/testsuite/g++.dg/gomp/attrs-imperfect2.C  |   34 +
 gcc/testsuite/g++.dg/gomp/attrs-imperfect3.C  |   33 +
 gcc/testsuite/g++.dg/gomp/attrs-imperfect4.C  |   33 +
 gcc/testsuite/g++.dg/gomp/attrs-imperfect5.C  |   57 +
 gcc/testsuite/g++.dg/gomp/pr41967.C           |    2 +-
 .../g++.dg/gomp/tpl-imperfect-gotos.C         |  161 ++
 .../g++.dg/gomp/tpl-imperfect-invalid-scope.C |   94 ++
 gcc/testsuite/gcc.dg/gomp/collapse-1.c        |   10 +-
 gcc/testsuite/gfortran.dg/gomp/collapse1.f90  |    6 +-
 gcc/testsuite/gfortran.dg/gomp/collapse2.f90  |   10 +-
 .../gfortran.dg/gomp/imperfect-gotos.f90      |   69 +
 .../gomp/imperfect-invalid-scope.f90          |   81 +
 gcc/testsuite/gfortran.dg/gomp/imperfect1.f90 |   39 +
 gcc/testsuite/gfortran.dg/gomp/imperfect2.f90 |   56 +
 gcc/testsuite/gfortran.dg/gomp/imperfect3.f90 |   29 +
 gcc/testsuite/gfortran.dg/gomp/imperfect4.f90 |   36 +
 gcc/testsuite/gfortran.dg/gomp/imperfect5.f90 |   67 +
 gcc/tree-inline.cc                            |    6 +
 gcc/tree-nested.cc                            |    3 +
 gcc/tree-pretty-print.cc                      |    4 +
 gcc/tree.def                                  |    9 +
 gcc/tree.h                                    |    3 +
 .../testsuite/libgomp.c++/attrs-imperfect1.C  |   76 +
 .../testsuite/libgomp.c++/attrs-imperfect2.C  |  114 ++
 .../testsuite/libgomp.c++/attrs-imperfect3.C  |  119 ++
 .../testsuite/libgomp.c++/attrs-imperfect4.C  |  117 ++
 .../testsuite/libgomp.c++/attrs-imperfect5.C  |   49 +
 .../testsuite/libgomp.c++/attrs-imperfect6.C  |  115 ++
 .../testsuite/libgomp.c++/imperfect-class-1.C |  169 +++
 .../testsuite/libgomp.c++/imperfect-class-2.C |  167 +++
 .../testsuite/libgomp.c++/imperfect-class-3.C |  167 +++
 .../libgomp.c++/imperfect-destructor.C        |  135 ++
 .../libgomp.c++/imperfect-template-1.C        |  172 +++
 .../libgomp.c++/imperfect-template-2.C        |  170 +++
 .../libgomp.c++/imperfect-template-3.C        |  170 +++
 .../libgomp.c-c++-common/imperfect1.c         |   76 +
 .../libgomp.c-c++-common/imperfect2.c         |  114 ++
 .../libgomp.c-c++-common/imperfect3.c         |  119 ++
 .../libgomp.c-c++-common/imperfect4.c         |  117 ++
 .../libgomp.c-c++-common/imperfect5.c         |   49 +
 .../libgomp.c-c++-common/imperfect6.c         |  115 ++
 .../libgomp.c-c++-common/target-imperfect1.c  |   81 +
 .../libgomp.c-c++-common/target-imperfect2.c  |  122 ++
 .../libgomp.c-c++-common/target-imperfect3.c  |  125 ++
 .../libgomp.c-c++-common/target-imperfect4.c  |  122 ++
 .../libgomp.fortran/imperfect-destructor.f90  |  142 ++
 .../testsuite/libgomp.fortran/imperfect1.f90  |   67 +
 .../testsuite/libgomp.fortran/imperfect2.f90  |  102 ++
 .../testsuite/libgomp.fortran/imperfect3.f90  |  110 ++
 .../testsuite/libgomp.fortran/imperfect4.f90  |  121 ++
 .../libgomp.fortran/target-imperfect1.f90     |   72 +
 .../libgomp.fortran/target-imperfect2.f90     |  110 ++
 .../libgomp.fortran/target-imperfect3.f90     |  116 ++
 .../libgomp.fortran/target-imperfect4.f90     |  126 ++
 97 files changed, 8270 insertions(+), 912 deletions(-)
 create mode 100644 gcc/omp-api.h
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-attributes.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-badloops.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-blocks.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-extension.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-gotos.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-invalid-scope.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-labels.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-legacy-syntax.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect-pragmas.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect2.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect3.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect4.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/imperfect5.c
 create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-imperfect1.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-imperfect2.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-imperfect3.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-imperfect4.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-imperfect5.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/tpl-imperfect-gotos.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/tpl-imperfect-invalid-scope.C
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect-gotos.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect-invalid-scope.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect1.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect2.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect3.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect4.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/imperfect5.f90
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect1.C
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect2.C
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect3.C
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect4.C
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect5.C
 create mode 100644 libgomp/testsuite/libgomp.c++/attrs-imperfect6.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-class-1.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-class-2.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-class-3.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-destructor.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-template-1.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-template-2.C
 create mode 100644 libgomp/testsuite/libgomp.c++/imperfect-template-3.C
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect1.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect2.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect3.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect4.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect5.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/imperfect6.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-imperfect1.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-imperfect2.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-imperfect3.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-imperfect4.c
 create mode 100644 libgomp/testsuite/libgomp.fortran/imperfect-destructor.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/imperfect1.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/imperfect2.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/imperfect3.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/imperfect4.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/target-imperfect1.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/target-imperfect2.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/target-imperfect3.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/target-imperfect4.f90

-- 
2.31.1


             reply	other threads:[~2023-07-23 22:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 22:15 Sandra Loosemore [this message]
2023-07-23 22:15 ` [PATCH V2 1/5] OpenMP: Add OMP_STRUCTURED_BLOCK and GIMPLE_OMP_STRUCTURED_BLOCK Sandra Loosemore
2023-08-22 13:01   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 2/5] OpenMP: C front end support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:23   ` Jakub Jelinek
2023-08-22 18:53     ` Sandra Loosemore
2023-08-24 11:49       ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 3/5] OpenMP: C++ " Sandra Loosemore
2023-08-22 13:31   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 4/5] OpenMP: New C/C++ testcases for imperfectly nested loops Sandra Loosemore
2023-08-22 13:34   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 5/5] OpenMP: Fortran support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:37   ` Jakub Jelinek
2023-08-24 16:36     ` Tobias Burnus
2023-08-22 12:56 ` [PATCH V2 0/5] OpenMP: " Jakub Jelinek

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=20230723221521.3739463-1-sandra@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).