aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-general.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-06-27 12:43:36 +0200
committerJakub Jelinek <jakub@redhat.com>2020-06-27 12:43:36 +0200
commitaed3ab253dada2b7d2ed63cc6a8e15e263d5dd35 (patch)
tree3fd34073f92ce78c1c3031fee739b8b0d0aa7f75 /gcc/omp-general.h
parent37995960984ea2222346dd9d168d332cd6f7adf0 (diff)
downloadgcc-aed3ab253dada2b7d2ed63cc6a8e15e263d5dd35.zip
gcc-aed3ab253dada2b7d2ed63cc6a8e15e263d5dd35.tar.gz
gcc-aed3ab253dada2b7d2ed63cc6a8e15e263d5dd35.tar.bz2
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.
Diffstat (limited to 'gcc/omp-general.h')
-rw-r--r--gcc/omp-general.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/omp-general.h b/gcc/omp-general.h
index 7c1122b..a763965 100644
--- a/gcc/omp-general.h
+++ b/gcc/omp-general.h
@@ -47,13 +47,16 @@ enum oacc_loop_flags {
or for non-rectangular loops:
for (V = M1 * W + N1; V cond M2 * W + N2; V += STEP;
where W is V of the OUTER-th loop (e.g. for OUTER 1 it is the
- the index of the immediately surrounding loop). */
+ the index of the immediately surrounding loop).
+ NON_RECT_REFERENCED is true for loops referenced by loops
+ with non-NULL M1 or M2. */
struct omp_for_data_loop
{
tree v, n1, n2, step, m1, m2;
- int outer;
enum tree_code cond_code;
+ int outer;
+ bool non_rect_referenced;
};
/* A structure describing the main elements of a parallel loop. */
@@ -67,6 +70,7 @@ struct omp_for_data
tree tiling; /* Tiling values (if non null). */
int collapse; /* Collapsed loops, 1 for a non-collapsed loop. */
int ordered;
+ int first_nonrect, last_nonrect;
bool have_nowait, have_ordered, simd_schedule, have_reductemp;
bool have_pointer_condtemp, have_scantemp, have_nonctrl_scantemp;
bool non_rect;