]> 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)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:15:09 +0000 (13:15 -0300)
commit357774b618058826d115398e02a22e9d4ef8c0e0
tree79decaf14d7656dc1bff2670a8dc9d5b49549512
parent21eba61de879b1e01804a3567bbb1e64750bdcee
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.
gcc/omp-expand.c
gcc/omp-general.c
gcc/omp-general.h
libgomp/testsuite/libgomp.c/loop-17.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/loop-18.c [new file with mode: 0644]