diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-08-13 09:06:05 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-08-13 09:06:05 +0200 |
commit | 2e47c8c6eac405ceb599bf5e31ac3717c22a008c (patch) | |
tree | 6b548e09bcebf00f74983be40030d2acc78db3ac /gcc/omp-general.c | |
parent | 7123217afb33d4a2860f552ad778a819cc8dea5e (diff) | |
download | gcc-2e47c8c6eac405ceb599bf5e31ac3717c22a008c.zip gcc-2e47c8c6eac405ceb599bf5e31ac3717c22a008c.tar.gz gcc-2e47c8c6eac405ceb599bf5e31ac3717c22a008c.tar.bz2 |
openmp: Add support for non-rectangular loops in taskloop construct
2020-08-13 Jakub Jelinek <jakub@redhat.com>
* gimplify.c (gimplify_omp_taskloop_expr): New function.
(gimplify_omp_for): Use it. For OMP_FOR_NON_RECTANGULAR
loops adjust in outer taskloop the var-outer decls.
* omp-expand.c (expand_omp_taskloop_for_inner): Handle non-rectangular
loops.
(expand_omp_for): Don't reject non-rectangular taskloop.
* omp-general.c (omp_extract_for_data): Don't assert that
non-rectangular loops have static schedule, instead treat loop->m1
or loop->m2 as if loop->n1 or loop->n2 is non-constant.
* testsuite/libgomp.c/loop-22.c (main): Add some further tests.
* testsuite/libgomp.c/loop-23.c (main): Likewise.
* testsuite/libgomp.c/loop-24.c: New test.
Diffstat (limited to 'gcc/omp-general.c')
-rw-r--r-- | gcc/omp-general.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/omp-general.c b/gcc/omp-general.c index 6e6d3e1..8e2665a 100644 --- a/gcc/omp-general.c +++ b/gcc/omp-general.c @@ -444,10 +444,6 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, = build_nonstandard_integer_type (TYPE_PRECISION (TREE_TYPE (loop->v)), 1); } - else if (loop->m1 || loop->m2) - /* Non-rectangular loops should use static schedule and no - ordered clause. */ - gcc_unreachable (); else if (iter_type != long_long_unsigned_type_node) { if (POINTER_TYPE_P (TREE_TYPE (loop->v))) @@ -463,7 +459,9 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, loop->n2, loop->step); else n = loop->n1; - if (TREE_CODE (n) != INTEGER_CST + if (loop->m1 + || loop->m2 + || TREE_CODE (n) != INTEGER_CST || tree_int_cst_lt (TYPE_MAX_VALUE (iter_type), n)) iter_type = long_long_unsigned_type_node; } @@ -484,7 +482,9 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, loop->n2, loop->step); n2 = loop->n1; } - if (TREE_CODE (n1) != INTEGER_CST + if (loop->m1 + || loop->m2 + || TREE_CODE (n1) != INTEGER_CST || TREE_CODE (n2) != INTEGER_CST || !tree_int_cst_lt (TYPE_MIN_VALUE (iter_type), n1) || !tree_int_cst_lt (n2, TYPE_MAX_VALUE (iter_type))) |