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


On 21/07/15 12:19, Thomas Schwinge wrote:
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,

That's not a similar transformation. The GOACC_kernels_internal call is removed.

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?

It's not a hard requirement, but it's probably a good idea.

Thanks,
- Tom



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