This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-4_9 inlines less funcs than gcc-4_8 because of used_as_abstract_origin flag.
- From: Wei Mi <wmi at google dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>, David Li <davidxl at google dot com>, Teresa Johnson <tejohnson at google dot com>, Dehao Chen <dehao at google dot com>
- Date: Sat, 22 Nov 2014 15:07:15 -0800
- Subject: Re: gcc-4_9 inlines less funcs than gcc-4_8 because of used_as_abstract_origin flag.
- Authentication-results: sourceware.org; auth=none
- References: <CA+4CFy7eHnH_cbOv8SON2grM-Wb7nJrSNba-FvDJYi3oaXEQrw at mail dot gmail dot com> <56D04223-99D3-46B1-97D5-07A1731723AE at gmail dot com> <CAFiYyc2Sdf5FASTVVCW7gTN6fUJbUtF=d4STppFkekg3hTJPTQ at mail dot gmail dot com> <20141122210844 dot GC27182 at kam dot mff dot cuni dot cz>
Thanks for the fix. Is it ok to backport it to gcc-4_9?
Thanks,
Wei.
On Sat, Nov 22, 2014 at 1:08 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this is patch I commited to mainline
>
> 2014-11-22 Jan Hubicka <hubicka@ucw.cz>
>
> * ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones
> as having abstract origin used.
> * ipa-inline-transform.c (can_remove_node_now_p_1): Drop abstract origin check.
> (clone_inlined_nodes): Copy abstract originflag.
> * ipa-cgraph.c (working): Use get_create to get abstract origin node.
> Index: ipa.c
> ===================================================================
> --- ipa.c (revision 217890)
> +++ ipa.c (working copy)
> @@ -360,9 +360,18 @@ symbol_table::remove_unreachable_nodes (
> && DECL_ABSTRACT_ORIGIN (node->decl))
> {
> struct cgraph_node *origin_node
> - = cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (node->decl));
> - origin_node->used_as_abstract_origin = true;
> - enqueue_node (origin_node, &first, &reachable);
> + = cgraph_node::get (DECL_ABSTRACT_ORIGIN (node->decl));
> + if (origin_node && !origin_node->used_as_abstract_origin)
> + {
> + origin_node->used_as_abstract_origin = true;
> + gcc_assert (!origin_node->prev_sibling_clone);
> + gcc_assert (!origin_node->next_sibling_clone);
> + for (cgraph_node *n = origin_node->clones; n;
> + n = n->next_sibling_clone)
> + if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
> + n->used_as_abstract_origin = true;
> + enqueue_node (origin_node, &first, &reachable);
> + }
> }
> /* If any symbol in a comdat group is reachable, force
> all externally visible symbols in the same comdat
> Index: ipa-inline-transform.c
> ===================================================================
> --- ipa-inline-transform.c (revision 217890)
> +++ ipa-inline-transform.c (working copy)
> @@ -100,7 +100,6 @@ can_remove_node_now_p_1 (struct cgraph_n
> the callgraph so references can point to it. */
> return (!node->address_taken
> && !node->has_aliases_p ()
> - && !node->used_as_abstract_origin
> && node->can_remove_if_no_direct_calls_p ()
> /* Inlining might enable more devirtualizing, so we want to remove
> those only after all devirtualizable virtual calls are processed.
> @@ -218,6 +217,7 @@ clone_inlined_nodes (struct cgraph_edge
> update_original, vNULL, true,
> inlining_into,
> NULL);
> + n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
> e->redirect_callee (n);
> }
> }
> Index: lto-cgraph.c
> ===================================================================
> --- lto-cgraph.c (revision 217890)
> +++ lto-cgraph.c (working copy)
> @@ -877,7 +877,8 @@ compute_ltrans_boundary (lto_symtab_enco
> if (DECL_ABSTRACT_ORIGIN (node->decl))
> {
> struct cgraph_node *origin_node
> - = cgraph_node::get (DECL_ABSTRACT_ORIGIN (node->decl));
> + = cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (node->decl));
> + origin_node->used_as_abstract_origin = true;
> add_node_to (encoder, origin_node, true);
> }
> }