[gcc r10-9067] More explicit checking of which OMP constructs we're expecting, part II

Thomas Schwinge tschwinge@gcc.gnu.org
Tue Nov 24 09:37:57 GMT 2020


https://gcc.gnu.org/g:6e8837438148d6ed3e512099b2d12d06836c2a45

commit r10-9067-g6e8837438148d6ed3e512099b2d12d06836c2a45
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Fri Nov 20 10:41:46 2020 +0100

    More explicit checking of which OMP constructs we're expecting, part II
    
    In particular, more precisely highlight what applies generally vs. the special
    handling for the current 'parloops'-based OpenACC 'kernels' implementation.
    
            gcc/
            * omp-expand.c (expand_oacc_for): More explicit checking of which
            OMP constructs we're expecting.
    
    (cherry picked from commit 8c3aa359ce33732273bbd61c5f9a2c607779b32e)

Diff:
---
 gcc/omp-expand.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 735e263c8f8..27adbaf15cb 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -5998,6 +5998,21 @@ expand_omp_taskloop_for_inner (struct omp_region *region,
 static void
 expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
 {
+  bool is_oacc_kernels_parallelized
+    = (lookup_attribute ("oacc kernels parallelized",
+			 DECL_ATTRIBUTES (current_function_decl)) != NULL);
+  {
+    bool is_oacc_kernels
+      = (lookup_attribute ("oacc kernels",
+			   DECL_ATTRIBUTES (current_function_decl)) != NULL);
+    if (is_oacc_kernels_parallelized)
+      gcc_checking_assert (is_oacc_kernels);
+  }
+  gcc_assert (gimple_in_ssa_p (cfun) == is_oacc_kernels_parallelized);
+  /* In the following, some of the 'gimple_in_ssa_p (cfun)' conditionals are
+     for SSA specifics, and some are for 'parloops' OpenACC
+     'kernels'-parallelized specifics.  */
+
   tree v = fd->loop.v;
   enum tree_code cond_code = fd->loop.cond_code;
   enum tree_code plus_code = PLUS_EXPR;


More information about the Gcc-cvs mailing list