This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] Dumping gimple for offload.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ilya Tocar <tocarip dot intel at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "Michael V. Zolotukhin" <michael dot v dot zolotukhin at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, gcc <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 25 Sep 2013 15:48:22 +0200
- Subject: Re: [gomp4] Dumping gimple for offload.
- Authentication-results: sourceware.org; auth=none
- References: <20130923132951 dot GA80051 at msticlxl7 dot ims dot intel dot com> <CAFiYyc3xJ2HWpds5fwe1HAnxzvQVbjdyL8zAK-4CfkchnBbH+g at mail dot gmail dot com> <20130925132924 dot GA122388 at msticlxl7 dot ims dot intel dot com>
On Wed, Sep 25, 2013 at 3:29 PM, Ilya Tocar <tocarip.intel@gmail.com> wrote:
> On 24 Sep 11:02, Richard Biener wrote:
>> On Mon, Sep 23, 2013 at 3:29 PM, Ilya Tocar <tocarip.intel@gmail.com> wrote:
>> > Hi,
>> >
>> > I've rebased my patch.
>> > Is it ok for gomp4
>>
>> Passing through "is_omp" looks bad - please find a more suitable place
>> to attach this meta-information. From a quick look you only need it to
>> produce an alternate section name,
>
> Mostly for name, but there are other uses
> (e. g. choosing decl states vector).
>
>> thus consider assigning the section
>> name in a different place.
>>
>> Richard.
>
> What do you mean by different place?
> I can add global dumping_omp_target variable to choose correct name,
> depending on it's value (patch below). Is it better?
More like passing down a different abstraction, like for
> @@ -907,9 +907,15 @@ output_symtab (void)
> {
> symtab_node node = lto_symtab_encoder_deref (encoder, i);
> if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
> - lto_output_node (ob, cnode, encoder);
> + {
> + if (!dumping_omp_target || lookup_attribute ("omp declare target",
> + DECL_ATTRIBUTES (node->symbol.decl)))
> + lto_output_node (ob, cnode, encoder);
> + }
> else
> - lto_output_varpool_node (ob, varpool (node), encoder);
> + if (!dumping_omp_target || lookup_attribute ("omp declare target",
> + DECL_ATTRIBUTES (node->symbol.decl)))
> + lto_output_varpool_node (ob, varpool (node), encoder);
>
> }
have the symtab encoder already not contain the varpool nodes you
don't need.
And instead of looking up attributes, mark the symtab node with a flag.
Maybe Honza has some ideas on how to design this into the machinery
rather than trying to fit in from the outside as well.
Richard.