Hi! As just discussed for the libgcc changes in <http://news.gmane.org/find-root.php?message_id=%3C87d2ad73ze.fsf%40schwinge.name%3E>, just some suggestions regarding the terminology, where I think that the term »target« might be confusing in comments or symbols' names. That is, in the following, »target« should possibly be replaced by »offload[ing]« or similar:
On Mon, 29 Sep 2014 21:37:04 +0400, Ilya Verbin <iver...@gmail.com> wrote: > --- a/gcc/lto-cgraph.c > +++ b/gcc/lto-cgraph.c > @@ -321,6 +321,11 @@ referenced_from_other_partition_p (symtab_node *node, > lto_symtab_encoder_t encod > > for (i = 0; node->iterate_referring (i, ref); i++) > { > + /* Ignore references from non-target nodes while streaming NODE into > + offload target section. */ > + if (!ref->referring->need_lto_streaming) > + continue; > + > if (ref->referring->in_other_partition > || !lto_symtab_encoder_in_partition_p (encoder, ref->referring)) > return true; > @@ -339,9 +344,16 @@ reachable_from_other_partition_p (struct cgraph_node > *node, lto_symtab_encoder_t > if (node->global.inlined_to) > return false; > for (e = node->callers; e; e = e->next_caller) > - if (e->caller->in_other_partition > - || !lto_symtab_encoder_in_partition_p (encoder, e->caller)) > - return true; > + { > + /* Ignore references from non-target nodes while streaming NODE into > + offload target section. */ > + if (!e->caller->need_lto_streaming) > + continue; > + > + if (e->caller->in_other_partition > + || !lto_symtab_encoder_in_partition_p (encoder, e->caller)) > + return true; > + } > return false; > } > --- a/gcc/lto-section-names.h > +++ b/gcc/lto-section-names.h > @@ -25,6 +25,11 @@ along with GCC; see the file COPYING3. If not see > name for the functions and static_initializers. For other types of > sections a '.' and the section type are appended. */ > #define LTO_SECTION_NAME_PREFIX ".gnu.lto_" > +#define OMP_SECTION_NAME_PREFIX ".gnu.target_lto_" What about: #define OFFLOAD_SECTION_NAME_PREFIX ".gnu.offload_lto_" > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -8337,6 +8345,11 @@ expand_omp_target (struct omp_region *region) > push_cfun (child_cfun); > cgraph_edge::rebuild_edges (); > > + /* Prevent IPA from removing child_fn as unreachable, since there are > no > + refs from the parent function to the target side child_fn. */ > + node = cgraph_node::get (child_fn); > + node->mark_force_output (); > + > /* Some EH regions might become dead, see PR34608. If > pass_cleanup_cfg isn't the first pass to happen with the > new child, these dead EH edges might cause problems. Grüße, Thomas
pgp39Ul0jdvBC.pgp
Description: PGP signature