public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <Tom_deVries@mentor.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
	Nathan Sidwell	<nathan@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [gomp4] remove kernel-specific launch
Date: Tue, 21 Jul 2015 12:07:00 -0000	[thread overview]
Message-ID: <55AE3082.1020507@mentor.com> (raw)
In-Reply-To: <87twsxu821.fsf@kepler.schwinge.homeip.net>

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


      reply	other threads:[~2015-07-21 11:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-19 16:14 Nathan Sidwell
2015-07-19 17:13 ` Tom de Vries
2015-07-19 21:05 ` Thomas Schwinge
2015-07-19 21:08   ` Tom de Vries
2015-07-19 21:10   ` Nathan Sidwell
2015-07-20 12:08     ` Tom de Vries
2015-07-20 12:45       ` Nathan Sidwell
2015-07-21 10:23       ` Thomas Schwinge
2015-07-21 12:07         ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55AE3082.1020507@mentor.com \
    --to=tom_devries@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@codesourcery.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).