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