public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-13] OpenMP: Handle loop transformation clauses in nested functions
@ 2023-06-14 21:59 Sandra Loosemore
  0 siblings, 0 replies; only message in thread
From: Sandra Loosemore @ 2023-06-14 21:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:62e64a55d3f8c0f4df5fc2de7af64098960ad70f

commit 62e64a55d3f8c0f4df5fc2de7af64098960ad70f
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Sat Jun 10 22:17:28 2023 +0000

    OpenMP: Handle loop transformation clauses in nested functions
    
    The new internal clauses introduced for loop transformations were missing
    from the big switch statements over all clauses in these functions.
    
    gcc/ChangeLog:
            * tree-nested.cc (convert_nonlocal_omp_clauses): Handle loop
            transformation clauses.
            (convert_local_omp_clauses): Likewise.
    
    libgomp/ChangeLog:
            * testsuite/libgomp.fortran/loop-transforms/nested-fn.f90: New test.
    
    Co-Authored-By: Frederik Harwath <frederik@codesourcery.com>

Diff:
---
 gcc/ChangeLog.omp                                     |  7 +++++++
 gcc/tree-nested.cc                                    | 14 ++++++++++++++
 libgomp/ChangeLog.omp                                 |  5 +++++
 .../libgomp.fortran/loop-transforms/nested-fn.f90     | 19 +++++++++++++++++++
 4 files changed, 45 insertions(+)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index b4ebf6c0dea..d77d01076c2 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,10 @@
+2023-06-13  Sandra Loosemore  <sandra@codesourcery.com>
+	    Frederik Harwath <frederik@codesourcery.com>
+
+	* tree-nested.cc (convert_nonlocal_omp_clauses): Handle loop
+	transformation clauses.
+	(convert_local_omp_clauses): Likewise.
+
 2023-06-12  Tobias Burnus  <tobias@codesourcery.com>
 
 	Backported from mainline:
diff --git a/gcc/tree-nested.cc b/gcc/tree-nested.cc
index 04651d86608..51c69dd3c10 100644
--- a/gcc/tree-nested.cc
+++ b/gcc/tree-nested.cc
@@ -1494,6 +1494,13 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 	case OMP_CLAUSE__OMPACC_:
 	  break;
 
+	  /* Clauses related to loop transforms.  */
+	case OMP_CLAUSE_TILE:
+	case OMP_CLAUSE_UNROLL_FULL:
+	case OMP_CLAUSE_UNROLL_PARTIAL:
+	case OMP_CLAUSE_UNROLL_NONE:
+	  break;
+
 	  /* The following clause belongs to the OpenACC cache directive, which
 	     is discarded during gimplification.  */
 	case OMP_CLAUSE__CACHE_:
@@ -2291,6 +2298,13 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 	case OMP_CLAUSE__OMPACC_:
 	  break;
 
+	  /* Clauses related to loop transforms.  */
+	case OMP_CLAUSE_TILE:
+	case OMP_CLAUSE_UNROLL_FULL:
+	case OMP_CLAUSE_UNROLL_PARTIAL:
+	case OMP_CLAUSE_UNROLL_NONE:
+	  break;
+
 	  /* The following clause belongs to the OpenACC cache directive, which
 	     is discarded during gimplification.  */
 	case OMP_CLAUSE__CACHE_:
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 60dc6c1f7c2..5ce5052a8dc 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2023-06-13  Sandra Loosemore  <sandra@codesourcery.com>
+	    Frederik Harwath <frederik@codesourcery.com>
+
+	* testsuite/libgomp.fortran/loop-transforms/nested-fn.f90: New test.
+
 2023-06-14  Tobias Burnus  <tobias@codesourcery.com>
 
 	Backported from mainline:
diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90
new file mode 100644
index 00000000000..dc70c9228fd
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90
@@ -0,0 +1,19 @@
+! { dg-do run }
+
+program foo
+  integer :: count
+contains
+
+subroutine s1 ()
+  integer :: i, count
+
+  count = 0
+
+  !$omp target parallel do
+  !$omp unroll partial
+  do i = 1, 100
+  end do
+
+end subroutine
+
+end program

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-14 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 21:59 [gcc/devel/omp/gcc-13] OpenMP: Handle loop transformation clauses in nested functions Sandra Loosemore

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).