[Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390)

Tobias Burnus Tobias_Burnus@mentor.com
Tue Sep 22 07:11:48 GMT 2020


Hi Honza & Jakub,

@Honza: please look at the decl alias handling of the actual patch.

a minor update – testing only on gcn did turn out to be insufficient:
nvptx does not support alias, cf. PR 97102 + 97106; hence xfailed.

I also had a typo in one 'dg-do run' but as -O0 is set explicitly,
'dg-do run' does not make sense. (no dg-do = run once, dg-do run =
run with multiple options, dg-do compile = compile only).
Hence, I have now removed the dg-do line.

On 9/17/20 1:15 AM, Tobias Burnus wrote:
> Hi Honza – some input would be really helpful!
>
> Hi Jakub – updated version below.
>
> On 9/16/20 12:36 PM, Jakub Jelinek wrote:
>> I think you want Honza on this primarily, I'm always lost
>> in the cgraph alias code.
> (Likewise as this thread shows)
>>> +      while (node->alias_target)
>>> +        node = symtab_node::get (node->alias_target);
>>> +      node = node->ultimate_alias_target ();
>> I think the above is either you walk the aliases yourself, or use
>> ultimate_alias_target, but not both.
>
> I think we need to distinguish between:
> * aliases which end up with the same symbol name
>   and are stored in the ref_list; example: cpp_implicit_alias.
> * aliases like with the alias attribute, which is handled
>   via alias_target and have different names.
>
> Just experimentally:
> * The 'while (node->alias_target)' properly resolves the
>   attribute testcase (libgomp.c-c++-common/pr96390.c).
>   Here, ultimate_alias_target () does not help as
>   node->analyzed == 0.
>
> * The 'node->ultimate_alias_target ()' works for the
>   cpp_implicit_alias case (libgomp.c++/pr96390.C).
>   Just looking at the alias target does not help as in this
>   case, alias_target == NULL.
>
>> And the second thing is, I'm not sure how the aliases behave if the
>> ultimate alias target is properly marked as omp declare target, but some
>> of the aliases are not.  The offloaded code will still call the alias,
>> so do we somehow arrange for the aliases to be also emitted into the
>> offloading LTO IL?
>> [...] I wonder if the aliases that are needed shouldn't
>> be marked node->offloadable and have "omp declare target" attribute
>> added
>> for them too.
>
> Done now.
>
> Okay – or do we find more issues?
>
> Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-tmpl-v6.diff
Type: text/x-patch
Size: 5365 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200922/02c23eac/attachment.bin>


More information about the Gcc-patches mailing list