This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Thomas Schwinge <thomas at codesourcery dot com>, Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Ilya Tocar <tocarip at gmail dot com>, Andrey Turetskiy <andrey dot turetskiy at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>
- Date: Mon, 20 Oct 2014 13:21:53 +0200
- Subject: Re: [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming
- Authentication-results: sourceware.org; auth=none
- References: <20140927181647 dot GA1819 at msticlxl57 dot ims dot intel dot com> <20140929011014 dot GA11758 at kam dot mff dot cuni dot cz> <20140929173704 dot GA7526 at msticlxl57 dot ims dot intel dot com> <878ul172w5 dot fsf at schwinge dot name> <20141001161332 dot GB54978 at msticlxl57 dot ims dot intel dot com> <alpine dot LSU dot 2 dot 11 dot 1410151612470 dot 20733 at zhemvz dot fhfr dot qr> <20141020111935 dot GA9362 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Oct 20, 2014 at 03:19:35PM +0400, Ilya Verbin wrote:
> > > + /* If '#pragma omp critical' is inside target region, the symbol must
> > > + have an 'omp declare target' attribute. */
> > > + omp_context *octx;
> > > + for (octx = ctx->outer; octx; octx = octx->outer)
> > > + if (is_targetreg_ctx (octx))
> > > + {
> > > + DECL_ATTRIBUTES (decl)
> > > + = tree_cons (get_identifier ("omp declare target"),
> > > + NULL_TREE, DECL_ATTRIBUTES (decl));
> >
> > Here - why not set a flag on cgraph_get_node (decl) instead?
>
> I thought that select_what_to_stream is exactly what you've suggested.
> Could you please clarify this? You propose to replace "omp declare target"
> attribure with some cgraph node flag like need_offload? But we'll need
> need_lto_streaming anyway, since for LTO it should be 1 for all nodes, but for
> offloading it should be equal to need_offload.
Note, the attribute is created usually by the FEs, at points where
cgraph/varpool nodes can't be created yet. So, it is not possible to get
rid of the artificial attribute easily, it could be cached in some
cgraph/varpool bit field of course.
Jakub