This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Correctly fill up cgraph_node::local.versionable flag.
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>, Martin Jambor <mjambor at suse dot cz>
- Date: Sat, 17 Oct 2015 21:49:46 +0200
- Subject: Re: [PATCH] Correctly fill up cgraph_node::local.versionable flag.
- Authentication-results: sourceware.org; auth=none
- References: <5620FC9F dot 2000903 at suse dot cz>
> Hello.
>
> I've been working on HSA branch, where we have a cloning pass running with all
> optimization levels. The patch makes computation of cgraph_node::local.versionability
> independent on IPA CP and uses the flag to verify that a function can be cloned.
>
> The patch can bootstrap on x86_64-linux-pc and survives test suite.
>
> Ready for trunk?
> Thanks,
> Martin
> >From d17b51257d5e01ab6bd9a018b08f8ed6fd39c029 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Thu, 8 Oct 2015 17:57:30 +0200
> Subject: [PATCH 1/3] Correctly fill up cgraph_node::local.versionable flag.
>
> gcc/ChangeLog:
>
> 2015-10-15 Martin Liska <mliska@suse.cz>
>
> * cgraphclones.c (cgraph_node::create_virtual_clone):
> Verify cgraph_node.local.versionable instead of calling
> tree_versionable_function_p.
> * ipa-cp.c (determine_versionability): Save the information
> to ipa_node_params summary.
> (ipcp_versionable_function_p): Use it.
> (ipcp_propagate_stage): Pass IPA_NODE_REF to a called function.
> (ipcp_generate_summary): Do not compute cgraph_node
> versionability.
If you want to use the flag at WPA time, you need to stream it for LTO.
I suppose this only passed testing because we have no testcases checking that
ipa-cp happens with LTO.
> * ipa-inline-analysis.c (inline_generate_summary): Compute
> visibility for all cgraph nodes.
> * ipa-prop.c (ipa_node_params_t::duplicate): Duplicate
> ipa_node_params::versionability.
> * ipa-prop.h (struct ipa_node_params): Declare it.
> ---
> gcc/cgraphclones.c | 2 +-
> gcc/ipa-cp.c | 15 ++++++---------
> gcc/ipa-inline-analysis.c | 4 ++++
> gcc/ipa-prop.c | 1 +
> gcc/ipa-prop.h | 2 ++
> 5 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
> index e51431c..5c04dc4 100644
> --- a/gcc/cgraphclones.c
> +++ b/gcc/cgraphclones.c
> @@ -570,7 +570,7 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers,
> char *name;
>
> if (!in_lto_p)
> - gcc_checking_assert (tree_versionable_function_p (old_decl));
> + gcc_checking_assert (local.versionable);
Then you should be able to drop in_lto_p here.
OK with that change.
Honza