public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] openmp: Handle explicit linear clause properly in combined constructs with target [PR99928]
@ 2021-05-20 12:10 Tobias Burnus
0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-05-20 12:10 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d20715d6eb2784204b459ef58136752d83eaf6b6
commit d20715d6eb2784204b459ef58136752d83eaf6b6
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu May 20 13:30:48 2021 +0200
openmp: Handle explicit linear clause properly in combined constructs with target [PR99928]
linear clause should have the effect of firstprivate+lastprivate (or for IVs
not declared in the construct lastprivate) on outer constructs and eventually
map(tofrom:) on target when combined with it.
2021-05-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99928
* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
explicit linear clause when combined with target, make it map(tofrom:)
instead of no clause or firstprivate.
* c-c++-common/gomp/pr99928-4.c: Remove all xfails.
* c-c++-common/gomp/pr99928-5.c: Likewise.
(cherry picked from commit 94fa4c67b95c12482b6087d8eef2d72f7b7ea254)
Diff:
---
gcc/ChangeLog.omp | 10 ++++++++++
gcc/gimplify.c | 5 ++---
gcc/testsuite/ChangeLog.omp | 9 +++++++++
gcc/testsuite/c-c++-common/gomp/pr99928-4.c | 12 ++++++------
gcc/testsuite/c-c++-common/gomp/pr99928-5.c | 16 ++++++++--------
5 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index b8f6bfbc036..4bde3e2ae90 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,13 @@
+2021-05-20 Tobias Burnus <tobias@codesourcery.com>
+
+ Backported from master:
+ 2021-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/99928
+ * gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
+ explicit linear clause when combined with target, make it map(tofrom:)
+ instead of no clause or firstprivate.
+
2021-05-19 Tobias Burnus <tobias@codesourcery.com>
Backported from master:
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5dc7816a23a..c5ea4dba086 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8915,9 +8915,8 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
else if (octx
&& octx->region_type == ORT_COMBINED_TARGET)
{
- flags &= ~GOVD_LASTPRIVATE;
- if (flags == GOVD_SEEN)
- break;
+ if (flags & GOVD_LASTPRIVATE)
+ flags = GOVD_SEEN | GOVD_MAP;
}
else
break;
diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 30b6c923d0f..afc5c93c3fc 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -1,3 +1,12 @@
+2021-05-20 Tobias Burnus <tobias@codesourcery.com>
+
+ Backported from master:
+ 2021-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/99928
+ * c-c++-common/gomp/pr99928-4.c: Remove all xfails.
+ * c-c++-common/gomp/pr99928-5.c: Likewise.
+
2021-05-19 Tobias Burnus <tobias@codesourcery.com>
Backported from master:
diff --git a/gcc/testsuite/c-c++-common/gomp/pr99928-4.c b/gcc/testsuite/c-c++-common/gomp/pr99928-4.c
index c03afc4df89..f35e7343db4 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr99928-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr99928-4.c
@@ -44,15 +44,15 @@ bar (void)
#pragma omp parallel master taskloop simd linear (l04)
for (int i = 0; i < 64; i++)
l04++;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l05" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l05\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l05" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l05\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(l05\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*linear\\(l05:1\\)" "gimple" } } */
#pragma omp target parallel for linear (l05)
for (int i = 0; i < 64; i++)
l05++;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l06" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l06\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l06" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l06\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*firstprivate\\(l06\\)" "gimple" } } *//* FIXME: This should be on for instead. */
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*lastprivate\\(l06\\)" "gimple" } } *//* FIXME: This should be on for instead. */
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*firstprivate\\(l06\\)" "gimple" } } *//* FIXME. */
@@ -61,8 +61,8 @@ bar (void)
#pragma omp target parallel for simd linear (l06)
for (int i = 0; i < 64; i++)
l06++;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l07" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l07\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:l07" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(l07\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*linear\\(l07:1\\)" "gimple" } } */
#pragma omp target simd linear (l07)
for (int i = 0; i < 64; i++)
diff --git a/gcc/testsuite/c-c++-common/gomp/pr99928-5.c b/gcc/testsuite/c-c++-common/gomp/pr99928-5.c
index 6eca9c8d952..7405188556e 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr99928-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr99928-5.c
@@ -52,22 +52,22 @@ bar (void)
#pragma omp parallel master taskloop simd linear (j05)
for (j05 = 0; j05 < 64; j05++)
;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j06" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j06\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j06" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j06\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*lastprivate\\(j06\\)" "gimple" } } *//* FIXME: This should be on for instead. */
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*lastprivate\\(j06\\)" "gimple" } } *//* FIXME. */
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*linear\\(j06:1\\)" "gimple" } } */
#pragma omp target parallel for simd linear (j06)
for (j06 = 0; j06 < 64; j06++)
;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j07" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j07\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j07" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j07\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*linear\\(j07:1\\)" "gimple" } } */
#pragma omp target simd linear (j07)
for (j07 = 0; j07 < 64; j07++)
;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j08" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j08\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j08" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j08\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*shared\\(j08\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp distribute\[^\n\r]*lastprivate\\(j08\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*lastprivate\\(j08\\)" "gimple" } } *//* FIXME: This should be on for instead. */
@@ -76,8 +76,8 @@ bar (void)
#pragma omp target teams distribute parallel for simd linear (j08)
for (j08 = 0; j08 < 64; j08++)
;
- /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j09" "gimple" { xfail *-*-* } } } */
- /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j09\\)" "gimple" { xfail *-*-* } } } */
+ /* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:j09" "gimple" } } */
+ /* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(j09\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*shared\\(j09\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp distribute\[^\n\r]*lastprivate\\(j09\\)" "gimple" } } */
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*linear\\(j09:1\\)" "gimple" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-20 12:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 12:10 [gcc/devel/omp/gcc-11] openmp: Handle explicit linear clause properly in combined constructs with target [PR99928] Tobias Burnus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).