]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: Dump cgraph_node UID instead of order into ipa-clones dump file
authorMartin Jambor <mjambor@suse.cz>
Fri, 16 May 2025 15:13:51 +0000 (17:13 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 16 May 2025 15:14:24 +0000 (17:14 +0200)
Since starting from GCC 15 the order is not unique for any
symtab_nodes but m_uid is, I believe we ought to dump the latter in
the ipa-clones dump, if only so that people can reliably match entries
about new clones to those about removed nodes (if any).

This patch also contains a fixes to a few other places where we have
so far dumped order to our ordinary dumps and which have been
identified by Michal Jires.

gcc/ChangeLog:

2025-05-16  Martin Jambor  <mjambor@suse.cz>

* cgraph.h (symtab_node): Make member function get_uid const.
* cgraphclones.cc (dump_callgraph_transformation): Dump m_uid of the
call graph nodes instead of order.
* cgraph.cc (cgraph_node::remove): Likewise.
* ipa-cp.cc (ipcp_lattice<valtype>::print): Likewise.
* ipa-sra.cc (ipa_sra_summarize_function): Likewise.
* symtab.cc (symtab_node::dump_base): Likewise.

Co-Authored-By: Michal Jires <mjires@suse.cz>
gcc/cgraph.cc
gcc/cgraph.h
gcc/cgraphclones.cc
gcc/ipa-cp.cc
gcc/ipa-sra.cc
gcc/symtab.cc

index 1a2ec38374ab56da6de661359f34edcf25551d2a..ac0f2519361b4cdb9643950a69615d1e05e4bc08 100644 (file)
@@ -1879,7 +1879,7 @@ cgraph_node::remove (void)
   clone_info *info, saved_info;
   if (symtab->ipa_clones_dump_file && symtab->cloned_nodes.contains (this))
     fprintf (symtab->ipa_clones_dump_file,
-            "Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), order,
+            "Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), get_uid (),
             DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
             DECL_SOURCE_COLUMN (decl));
 
index f4ee29e998c37993570423a0addbf36e344c49a8..8dbe36eac09df79321079d3f4fbe70c891aa6930 100644 (file)
@@ -493,7 +493,7 @@ public:
   static inline void checking_verify_symtab_nodes (void);
 
   /* Get unique identifier of the node.  */
-  inline int get_uid ()
+  inline int get_uid () const
   {
     return m_uid;
   }
index b45ac4977331130c304488c348b69d31169589f8..c160e8b6985b9175b3f9e9dbe47afcf1f395ffde 100644 (file)
@@ -324,11 +324,11 @@ dump_callgraph_transformation (const cgraph_node *original,
     {
       fprintf (symtab->ipa_clones_dump_file,
               "Callgraph clone;%s;%d;%s;%d;%d;%s;%d;%s;%d;%d;%s\n",
-              original->asm_name (), original->order,
+              original->asm_name (), original->get_uid (),
               DECL_SOURCE_FILE (original->decl),
               DECL_SOURCE_LINE (original->decl),
               DECL_SOURCE_COLUMN (original->decl), clone->asm_name (),
-              clone->order, DECL_SOURCE_FILE (clone->decl),
+              clone->get_uid (), DECL_SOURCE_FILE (clone->decl),
               DECL_SOURCE_LINE (clone->decl), DECL_SOURCE_COLUMN (clone->decl),
               suffix);
 
index b41148c74de36527a4f993b0a2b6a1065fc65ec7..f06ac46dfffbe7eb1ed2a7b5350dc0b5ac2a0489 100644 (file)
@@ -288,7 +288,7 @@ ipcp_lattice<valtype>::print (FILE * f, bool dump_sources, bool dump_benefits)
          else
            fprintf (f, " [scc: %i, from:", val->scc_no);
          for (s = val->sources; s; s = s->next)
-           fprintf (f, " %i(%f)", s->cs->caller->order,
+           fprintf (f, " %i(%f)", s->cs->caller->get_uid (),
                     s->cs->sreal_frequency ().to_double ());
          fprintf (f, "]");
        }
index 1331ba49b507b45096e120a3246b33e44cd2dbc1..88bfae9502c73a79edb4f0f51ebd2835234d88b3 100644 (file)
@@ -4644,7 +4644,7 @@ ipa_sra_summarize_function (cgraph_node *node)
 {
   if (dump_file)
     fprintf (dump_file, "Creating summary for %s/%i:\n", node->name (),
-            node->order);
+            node->get_uid ());
   gcc_obstack_init (&gensum_obstack);
   loaded_decls = new hash_set<tree>;
 
index fe9c031247f94123e7e695809e68b4837b46c995..fc1155f469642668a56a69098af6b9e00789f3f8 100644 (file)
@@ -989,10 +989,10 @@ symtab_node::dump_base (FILE *f)
             same_comdat_group->dump_asm_name ());
   if (next_sharing_asm_name)
     fprintf (f, "  next sharing asm name: %i\n",
-            next_sharing_asm_name->order);
+            next_sharing_asm_name->get_uid ());
   if (previous_sharing_asm_name)
     fprintf (f, "  previous sharing asm name: %i\n",
-            previous_sharing_asm_name->order);
+            previous_sharing_asm_name->get_uid ());
 
   if (address_taken)
     fprintf (f, "  Address is taken.\n");