On 19/07/15 23:08, Nathan Sidwell wrote:
On 07/19/15 16:30, Thomas Schwinge wrote:

     gcc/tree-parloops.c:    /* Remove GOACC_kernels.  */
     libgomp/libgomp.map:    GOACC_kernels;
     libgomp/libgomp_g.h:extern void GOACC_kernels (int, void (*)
(void *), size_t,

I fixed all byt the parloops comment.  That comment didn't really make
sense to me -- it seems to be doing something with the pragma not the
call.   Perhaps Tom could correct/clarify it?


Committed as attached.

Does it make sense then to rename GOACC_kernels_internal to
GOACC_kernels?

I  agree with Tom.  But perhaps it should be an internal fn? IIUC those
are for pseudo-funcs that should be converted to something else before
the end of compilation.

Turning it into an internal fn will make it harder to convert a GOACC_kernels_internal call into a GOACC_parallel call, which we're doing here in omp-low.c:
...
          tree fndecl = builtin_decl_explicit (BUILT_IN_GOACC_PARALLEL);
          gimple_call_set_fndecl (call, fndecl);
          gimple_call_set_fntype (call, TREE_TYPE (fndecl));
          gimple_call_reset_alias_info (call);
 ...

Thanks,
- Tom

Update create_parallel_loop for remove GOACC_kernels

2015-07-20  Tom de Vries  <t...@codesourcery.com>

	* tree-parloops.c (create_parallel_loop): Update comments for removal of
	GOACC_kernels.  Rename goacc_kernels variable into
	goacc_kernels_internal.
---
 gcc/tree-parloops.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 149c336..7111f93 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2045,11 +2045,12 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
     }
   else
     {
-      /* Create oacc parallel pragma based on oacc kernels pragma.  */
+      /* Create oacc parallel pragma based on oacc kernels pragma and
+	 GOAC_kernels_internal call.  */
       gomp_target *kernels = as_a <gomp_target *> (gsi_stmt (gsi));
 
       gsi_prev (&gsi);
-      gcall *goacc_kernels = as_a <gcall *> (gsi_stmt (gsi));
+      gcall *goacc_kernels_internal = as_a <gcall *> (gsi_stmt (gsi));
 
       tree clauses = gimple_omp_target_clauses (kernels);
       /* FIXME: We need a more intelligent mapping onto vector, gangs,
@@ -2070,7 +2071,8 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
       gimple_omp_target_set_child_fn (stmt, child_fn);
       tree data_arg = gimple_omp_target_data_arg (kernels);
       gimple_omp_target_set_data_arg (stmt, data_arg);
-      tree ganglocal_size = gimple_call_arg (goacc_kernels, /* TODO */ 9);
+      tree ganglocal_size
+	= gimple_call_arg (goacc_kernels_internal, /* TODO */ 9);
       gimple_omp_target_set_ganglocal_size (stmt, ganglocal_size);
 
       gimple_set_location (stmt, loc);
@@ -2085,7 +2087,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
 	/* Insert pragma acc parallel.  */
 	gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
 
-	/* Remove GOACC_kernels.  */
+	/* Remove GOACC_kernels_internal call.  */
 	replace_uses_by (gimple_vdef (gsi_stmt (gsi2)),
 			 gimple_vuse (gsi_stmt (gsi2)));
 	gsi_remove (&gsi2, true);
-- 
1.9.1

Reply via email to