On Mon, Apr 28, 2025 at 4:16 PM Martin Jambor <mjam...@suse.cz> wrote:
>
> Hi
>
> in PR 119852 we agreed that since the NULL-ness of the suffix
> parameter should prevent creation of a record in the ipa-clones
> dump (which is implemented by a previous patch), it should not default
> to NULL.
>
> Bootstrapped and tested on x86_64-linux.  OK for master?

OK

> Thanks,
>
> Martin
>
>
>
> gcc/ChangeLog:
>
> 2025-04-25  Martin Jambor  <mjam...@suse.cz>
>
>         PR ipa/119852
>         * cgraph.h (cgraph_node::create_clone): Remove the default value of
>         argument suffix.  Update function comment.
>         * cgraphclones.cc (cgraph_node::create_clone): Update function 
> comment.
>         * ipa-inline-transform.cc (clone_inlined_nodes): Pass NULL to suffix
>         of create_clone explicitely.
>         * ipa-inline.cc (recursive_inlining): Likewise.
>         * lto-cgraph.cc (input_node): Likewise.
> ---
>  gcc/cgraph.h                | 10 +++++++---
>  gcc/cgraphclones.cc         |  7 ++++++-
>  gcc/ipa-inline-transform.cc |  2 +-
>  gcc/ipa-inline.cc           |  2 +-
>  gcc/lto-cgraph.cc           |  2 +-
>  5 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/gcc/cgraph.h b/gcc/cgraph.h
> index 2b374d2f96f..5b67717dbf2 100644
> --- a/gcc/cgraph.h
> +++ b/gcc/cgraph.h
> @@ -965,15 +965,19 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : 
> public symtab_node
>       If the new node is being inlined into another one, NEW_INLINED_TO 
> should be
>       the outline function the new one is (even indirectly) inlined to.
>       All hooks will see this in node's inlined_to, when invoked.
> -     Can be NULL if the node is not inlined.  SUFFIX is string that is 
> appended
> -     to the original name.  */
> +     Should be NULL if the node is not inlined.
> +
> +     SUFFIX is string that is appended to the original name, it should only 
> be
> +     NULL if NEW_INLINED_TO is not NULL or if the clone being created is
> +     temporary and a record about it should not be added into the ipa-clones
> +     dump file.  */
>    cgraph_node *create_clone (tree decl, profile_count count,
>                              bool update_original,
>                              vec<cgraph_edge *> redirect_callers,
>                              bool call_duplication_hook,
>                              cgraph_node *new_inlined_to,
>                              ipa_param_adjustments *param_adjustments,
> -                            const char *suffix = NULL);
> +                            const char *suffix);
>
>    /* Create callgraph node clone with new declaration.  The actual body will 
> be
>       copied later at compilation stage.  The name of the new clone will be
> diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
> index 761fbdfa000..c160e8b6985 100644
> --- a/gcc/cgraphclones.cc
> +++ b/gcc/cgraphclones.cc
> @@ -366,9 +366,14 @@ localize_profile (cgraph_node *n)
>
>     If the new node is being inlined into another one, NEW_INLINED_TO should 
> be
>     the outline function the new one is (even indirectly) inlined to.  All 
> hooks
> -   will see this in node's inlined_to, when invoked.  Can be NULL if the
> +   will see this in node's inlined_to, when invoked.  Should be NULL if the
>     node is not inlined.
>
> +   SUFFIX is string that is appended to the original name, it should only be
> +   NULL if NEW_INLINED_TO is not NULL or if the clone being created is
> +   temporary and a record about it should not be added into the ipa-clones 
> dump
> +   file.
> +
>     If PARAM_ADJUSTMENTS is non-NULL, the parameter manipulation information
>     will be overwritten by the new structure.  Otherwise the new node will
>     share parameter manipulation information with the original node.  */
> diff --git a/gcc/ipa-inline-transform.cc b/gcc/ipa-inline-transform.cc
> index d2c9a2da6de..458a0b43c35 100644
> --- a/gcc/ipa-inline-transform.cc
> +++ b/gcc/ipa-inline-transform.cc
> @@ -225,7 +225,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool 
> duplicate,
>                                        e->count,
>                                        update_original, vNULL, true,
>                                        inlining_into,
> -                                      NULL);
> +                                      NULL, NULL);
>           n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
>           e->redirect_callee (n);
>         }
> diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
> index d9fc111a9e7..ef3d1743188 100644
> --- a/gcc/ipa-inline.cc
> +++ b/gcc/ipa-inline.cc
> @@ -1842,7 +1842,7 @@ recursive_inlining (struct cgraph_edge *edge,
>         {
>           /* We need original clone to copy around.  */
>           master_clone = node->create_clone (node->decl, node->count,
> -           false, vNULL, true, NULL, NULL);
> +           false, vNULL, true, NULL, NULL, NULL);
>           for (e = master_clone->callees; e; e = e->next_callee)
>             if (!e->inline_failed)
>               clone_inlined_nodes (e, true, false, NULL);
> diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
> index 8439c51fb2b..ec34f659d6a 100644
> --- a/gcc/lto-cgraph.cc
> +++ b/gcc/lto-cgraph.cc
> @@ -1303,7 +1303,7 @@ input_node (struct lto_file_decl_data *file_data,
>      {
>        node = dyn_cast<cgraph_node *> (nodes[clone_ref])->create_clone 
> (fn_decl,
>         profile_count::uninitialized (), false,
> -       vNULL, false, NULL, NULL);
> +       vNULL, false, NULL, NULL, NULL);
>      }
>    else
>      {
> --
> 2.49.0
>

Reply via email to