From 25651634436238d505c586fd308cdd5b6c5db8f9 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 12 May 2017 11:02:55 +0200 Subject: Use "oacc kernels" attribute for OpenACC kernels gcc/ * omp-expand.c (expand_omp_target) : Set "oacc kernels" attribute. * omp-general.c (oacc_set_fn_attrib): Remove is_kernel formal parameter. Adjust all users. (oacc_fn_attrib_kernels_p): Remove function. * omp-offload.c (execute_oacc_device_lower): Look for "oacc kernels" attribute instead of calling oacc_fn_attrib_kernels_p. * tree-ssa-loop.c (gate_oacc_kernels): Likewise. * tree-parloops.c (create_parallel_loop): If oacc_kernels_p, assert "oacc kernels" attribute is set. gcc/testsuite/ * c-c++-common/goacc/classify-kernels-unparallelized.c: Adjust. * c-c++-common/goacc/classify-kernels.c: Likewise. * c-c++-common/goacc/classify-parallel.c: Likewise. * c-c++-common/goacc/classify-routine.c: Likewise. * gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise. * gfortran.dg/goacc/classify-kernels.f95: Likewise. * gfortran.dg/goacc/classify-parallel.f95: Likewise. * gfortran.dg/goacc/classify-routine.f95: Likewise. From-SVN: r247955 --- gcc/omp-general.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'gcc/omp-general.c') diff --git a/gcc/omp-general.c b/gcc/omp-general.c index 3f9aec8..9a5ed88 100644 --- a/gcc/omp-general.c +++ b/gcc/omp-general.c @@ -515,11 +515,10 @@ oacc_replace_fn_attrib (tree fn, tree dims) /* Scan CLAUSES for launch dimensions and attach them to the oacc function attribute. Push any that are non-constant onto the ARGS - list, along with an appropriate GOMP_LAUNCH_DIM tag. IS_KERNEL is - true, if these are for a kernels region offload function. */ + list, along with an appropriate GOMP_LAUNCH_DIM tag. */ void -oacc_set_fn_attrib (tree fn, tree clauses, bool is_kernel, vec *args) +oacc_set_fn_attrib (tree fn, tree clauses, vec *args) { /* Must match GOMP_DIM ordering. */ static const omp_clause_code ids[] @@ -545,9 +544,6 @@ oacc_set_fn_attrib (tree fn, tree clauses, bool is_kernel, vec *args) non_const |= GOMP_DIM_MASK (ix); } attr = tree_cons (NULL_TREE, dim, attr); - /* Note kernelness with TREE_PUBLIC. */ - if (is_kernel) - TREE_PUBLIC (attr) = 1; } oacc_replace_fn_attrib (fn, attr); @@ -616,16 +612,6 @@ oacc_get_fn_attrib (tree fn) return lookup_attribute (OACC_FN_ATTRIB, DECL_ATTRIBUTES (fn)); } -/* Return true if this oacc fn attrib is for a kernels offload - region. We use the TREE_PUBLIC flag of each dimension -- only - need to check the first one. */ - -bool -oacc_fn_attrib_kernels_p (tree attr) -{ - return TREE_PUBLIC (TREE_VALUE (attr)); -} - /* Extract an oacc execution dimension from FN. FN must be an offloaded function or routine that has already had its execution dimensions lowered to the target-specific values. */ -- cgit v1.1