This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp4] remove kernel-specific launch


Hi!

Thanks for the cleanup!

On Mon, 20 Jul 2015 11:54:48 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 19/07/15 23:08, Nathan Sidwell wrote:
> > On 07/19/15 16:30, Thomas Schwinge wrote:
> >> Does it make sense then to rename GOACC_kernels_internal to
> >> GOACC_kernels?

> > [...] 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);
>   ...

..., and also a similar transformation in gcc/tree-parloops.c, I think,
which I've not been too fond of ;-) anyway, because of:

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

... this "clumsy" argument copying.

As I understand it, there is an implicit/non-obvious requirement that the
GOACC_kernels_internal and GOACC_parallel function/built-in signatures
match?  Does it thus make sense to add a comment to the definition of the
GOACC_kernels_internal, in gcc/omp-builtins.def, to describe that?


Committed in r226035:

commit fbf4d5131957d06b12ce19a1b870ec6b383acbfd
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Jul 21 10:18:07 2015 +0000

    More GOACC_kernels removal fixes
    
    ... for r225994, and r225989.
    
    	gcc/
    	* tree-parloops.c (create_parallel_loop): Typo fix.
    	libgomp/
    	* libgomp_g.h (GOACC_kernels): Remove.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@226035 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp     |    4 ++++
 gcc/tree-parloops.c    |    2 +-
 libgomp/ChangeLog.gomp |    5 ++++-
 libgomp/libgomp_g.h    |    3 ---
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 7bb7c09..2351d85 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2015-07-21  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* tree-parloops.c (create_parallel_loop): Typo fix.
+
 2015-07-20  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* config/nvptx/nvptx.c (nvptx_builtins): Delete enum.
diff --git gcc/tree-parloops.c gcc/tree-parloops.c
index 7111f93..a825e7b 100644
--- gcc/tree-parloops.c
+++ gcc/tree-parloops.c
@@ -2046,7 +2046,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
   else
     {
       /* Create oacc parallel pragma based on oacc kernels pragma and
-	 GOAC_kernels_internal call.  */
+	 GOACC_kernels_internal call.  */
       gomp_target *kernels = as_a <gomp_target *> (gsi_stmt (gsi));
 
       gsi_prev (&gsi);
diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 02a84dc..161255b 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2015-07-21  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* libgomp_g.h (GOACC_kernels): Remove.
+
 2015-07-20  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* oacc-parallel.c (GOACC_parallel): Move variadic handling into
@@ -21,7 +25,6 @@
 
 	* oacc-parallel.c (GOACC_kernels): Delete.
 	* libgomp.map: Remove GOACC_kernels.
-	* libgomp_g.h (GOACC_kernels): Remove.
 
 2015-07-17  Nathan Sidwell  <nathan@codesourcery.com>
 
diff --git libgomp/libgomp_g.h libgomp/libgomp_g.h
index 943ee67..63ae972 100644
--- libgomp/libgomp_g.h
+++ libgomp/libgomp_g.h
@@ -222,9 +222,6 @@ extern void GOACC_data_start (int, size_t, void **, size_t *,
 extern void GOACC_data_end (void);
 extern void GOACC_enter_exit_data (int, size_t, void **,
 				   size_t *, unsigned short *, int, int, ...);
-extern void GOACC_kernels (int, void (*) (void *), size_t,
-			   void **, size_t *, unsigned short *, int, int, int,
-			   size_t, int, int, ...);
 extern void GOACC_parallel (int, void (*) (void *), size_t,
 			    void **, size_t *, unsigned short *, int, int, int,
 			    size_t, int, int, ...);


GrÃÃe,
 Thomas

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]