]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Non-rectangular loop support for non-composite worksharing loops and distribute
authorJakub Jelinek <jakub@redhat.com>
Sat, 27 Jun 2020 10:43:36 +0000 (12:43 +0200)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 9 Feb 2021 18:09:02 +0000 (10:09 -0800)
commitb2eabb179a3e2eab5eda2cc0829ba88756252189
treec79196dd4077d54ea45371bc52b5ffb695a8ea90
parent076673fd7c64940b761ce980ea54df7ef6dd2199
openmp: Non-rectangular loop support for non-composite worksharing loops and distribute

This implements the fallback mentioned in
https://gcc.gnu.org/pipermail/gcc/2020-June/232874.html
Special cases for triangular loops etc. to follow later, also composite
constructs not supported yet (need to check the passing of temporaries around)
and lastprivate might not give the same answers as serial loop if the last
innermost body iteration isn't the last one for some of the outer loops
(that will need to be solved separately together with rectangular loops that have no
innermost body iterations, but some of the outer loops actually iterate).
Also, simd needs work.

2020-06-27  Jakub Jelinek  <jakub@redhat.com>

* omp-general.h (struct omp_for_data_loop): Add non_rect_referenced
member, move outer member.
(struct omp_for_data): Add first_nonrect and last_nonrect members.
* omp-general.c (omp_extract_for_data): Initialize first_nonrect,
last_nonrect and non_rect_referenced members.
* omp-expand.c (expand_omp_for_init_counts): Handle non-rectangular
loops.
(expand_omp_for_init_vars): Add nonrect_bounds parameter.  Handle
non-rectangular loops.
(extract_omp_for_update_vars): Likewise.
(expand_omp_for_generic, expand_omp_for_static_nochunk,
expand_omp_for_static_chunk, expand_omp_simd,
expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): Adjust
expand_omp_for_init_vars and extract_omp_for_update_vars callers.
(expand_omp_for): Don't sorry on non-composite worksharing-loop or
distribute.

* testsuite/libgomp.c/loop-17.c: New test.
* testsuite/libgomp.c/loop-18.c: New test.

(cherry picked from commit aed3ab253dada2b7d2ed63cc6a8e15e263d5dd35)
gcc/ChangeLog.omp
gcc/omp-expand.c
gcc/omp-general.c
gcc/omp-general.h
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.c/loop-17.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/loop-18.c [new file with mode: 0644]