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

2020-09-25 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 23, 2020 at 05:45:12PM +0200, Tobias Burnus wrote: > On 9/23/20 4:06 PM, Jakub Jelinek wrote: > > > What I really meant was: > I did now something based on this. > > > + gcc_assert (node->alias && node->analyzed); > > I believe from previous testing that node->analyzed

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

2020-09-23 Thread Tobias Burnus
On 9/23/20 4:06 PM, Jakub Jelinek wrote: What I really meant was: I did now something based on this. + gcc_assert (node->alias && node->analyzed); I believe from previous testing that node->analyzed is 0 for the testcase at hand — and, hence, ultimate_alias_target() did not

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

2020-09-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 23, 2020 at 03:52:12PM +0200, Tobias Burnus wrote: > + if (TREE_CODE (*tp) == FUNCTION_DECL) > { > + tree decl = *tp; >tree id = get_identifier ("omp declare target"); > - if (!DECL_EXTERNAL (*tp) && DECL_SAVED_TREE (*tp)) > - ((vec *) data)->safe_push

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

2020-09-23 Thread Tobias Burnus
And another try :-) This time avoiding the ultimate_alias_target completely and just using: + if (node->cpp_implicit_alias) + node = node->get_alias_target (); OK? On 9/22/20 5:39 PM, Tobias Burnus wrote: On 9/22/20 4:24 PM, Jakub Jelinek wrote: On Tue, Sep 22,

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

2020-09-22 Thread Tobias Burnus
On 9/22/20 4:24 PM, Jakub Jelinek wrote: On Tue, Sep 22, 2020 at 04:11:19PM +0200, Tobias Burnus wrote: + while (node->alias_target) +{ + node = node->ultimate_alias_target (); At least in theory, ultimate_alias_target can look through multiple aliases. Granted. But we

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

2020-09-22 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 22, 2020 at 04:11:19PM +0200, Tobias Burnus wrote: > + while (node->alias_target) > + { > + node = node->ultimate_alias_target (); At least in theory, ultimate_alias_target can look through multiple aliases. While it might not do that most of the time because

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

2020-09-22 Thread Tobias Burnus
On 9/22/20 9:36 AM, Jakub Jelinek wrote: On Tue, Sep 22, 2020 at 09:11:48AM +0200, Tobias Burnus wrote: Okay – or do we find more issues? I'm afraid so. We will slowly converge, hopefully ;-) Consider: int v; #pragma omp declare target to (v) void foo (void) { v++; } void bar (void)

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

2020-09-22 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 22, 2020 at 09:11:48AM +0200, Tobias Burnus wrote: > > Okay – or do we find more issues? I'm afraid so. > + if (omp_declare_target_fn_p (decl) > + || lookup_attribute ("omp declare target host", > +DECL_ATTRIBUTES (decl))) > +

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

2020-09-22 Thread Tobias Burnus
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,

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

2020-09-16 Thread Tobias Burnus
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 =

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

2020-09-16 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 03:25:29PM +0200, Tobias Burnus wrote: > Updated version attached. Does it seem to make sense? I think you want Honza on this primarily, I'm always lost in the cgraph alias code. > --- a/gcc/omp-offload.c > +++ b/gcc/omp-offload.c > @@ -196,21 +196,34 @@

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

2020-09-14 Thread Tobias Burnus
Hello Jakub, hi Honza, On 8/31/20 5:53 PM, Jakub Jelinek wrote: On Mon, Aug 03, 2020 at 05:37:40PM +0200, Tobias Burnus wrote: It turned out that the omp_discover_declare_target_tgt_fn_r discovered all nodes – but as it tagged the C++ alias nodes and not the streamed-out nodes, no device

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

2020-08-31 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 03, 2020 at 05:37:40PM +0200, Tobias Burnus wrote: > It turned out that the omp_discover_declare_target_tgt_fn_r > discovered all nodes – but as it tagged the C++ alias nodes > and not the streamed-out nodes, no device function was created > and one got link errors if offloading

Re: *PING**2 – Re: [Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390)

2020-08-25 Thread Tobias Burnus
And another PING. On 8/17/20 9:17 AM, Tobias Burnus wrote: On 8/3/20 5:37 PM, Tobias Burnus wrote: It turned out that the omp_discover_declare_target_tgt_fn_r discovered all nodes – but as it tagged the C++ alias nodes and not the streamed-out nodes, no device function was created and one got

*PING* – Re: [Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390)

2020-08-17 Thread Tobias Burnus
On 8/3/20 5:37 PM, Tobias Burnus wrote: It turned out that the omp_discover_declare_target_tgt_fn_r discovered all nodes – but as it tagged the C++ alias nodes and not the streamed-out nodes, no device function was created and one got link errors if offloading devices were configured. (Only with

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

2020-08-03 Thread Tobias Burnus
It turned out that the omp_discover_declare_target_tgt_fn_r discovered all nodes – but as it tagged the C++ alias nodes and not the streamed-out nodes, no device function was created and one got link errors if offloading devices were configured. (Only with -O0 as otherwise inlining happened.)