]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Add C/C++ support for loop transformations on inner loops
authorFrederik Harwath <frederik@codesourcery.com>
Fri, 24 Mar 2023 17:20:08 +0000 (18:20 +0100)
committerFrederik Harwath <frederik@codesourcery.com>
Mon, 27 Mar 2023 10:44:13 +0000 (12:44 +0200)
commit09f39bb11413d05c4cd87991bf223e1c006c3707
tree3df80f75157cf2370d63065917b6d1529b207e0b
parent8e2248956953741ac458bf0bd1927e25d3a7fcda
openmp: Add C/C++ support for loop transformations on inner loops

Add the parsing of loop transformations on inner loops of a loop-nest.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_omp_nested_loop_transform_clauses):
Add argument for the level of loop-nest at which the clauses
appear, ...
(c_parser_omp_tile): ... adjust use here,
(c_parser_omp_unroll): ... and here,
(c_parser_omp_for_loop): ... and here.  Stop treating loop
transformations like intervening code, parse them, and adjust
the loop-nest depth if necessary for tiling.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_is_pragma): New function.
(cp_parser_omp_nested_loop_transform_clauses):
Add argument for the level of loop-nest at which the clauses
appear, ...
(cp_parser_omp_tile): ... adjust use here,
(cp_parser_omp_unroll): ... and here,
(cp_parser_omp_for_loop): ... and here.  Stop treating loop

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/loop-transforms/unroll-inner-1.c: New test.
* c-c++-common/gomp/loop-transforms/unroll-inner-2.c: New test.

libgomp/ChangeLog
* testsuite/libgomp.c++/loop-transforms/tile-1.C: Deleted, replaced by
matrix-* tests.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-1.h:
New header file for new tests.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-constant-iter.h:
Likewise.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-helper.h:
Likewise.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-no-directive-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-no-directive-unroll-full-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-distribute-parallel-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-masked-taskloop-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-masked-taskloop-simd-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-target-parallel-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-target-teams-distribute-parallel-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-taskloop-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-teams-distribute-parallel-for-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-simd-1.c:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/matrix-transform-variants-1.h:
New test.
* testsuite/libgomp.c-c++-common/loop-transforms/unroll-non-rect-1.c:
New test.
25 files changed:
gcc/c/c-parser.cc
gcc/cp/parser.cc
gcc/testsuite/c-c++-common/gomp/loop-transforms/imperfect-loop-nest.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/loop-transforms/unroll-inner-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/loop-transforms/unroll-inner-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/loop-transforms/unroll-non-rect-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/loop-transforms/unroll-non-rect-2.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/loop-transforms/tile-1.C [deleted file]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-1.h [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-constant-iter.h [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-helper.h [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-no-directive-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-no-directive-unroll-full-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-distribute-parallel-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-masked-taskloop-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-parallel-masked-taskloop-simd-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-target-parallel-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-target-teams-distribute-parallel-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-taskloop-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-omp-teams-distribute-parallel-for-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-simd-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/matrix-transform-variants-1.h [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/loop-transforms/unroll-non-rect-1.c [new file with mode: 0644]