Fix dump in clone materialization
authorFeng Xue <fxue@os.amperecomputing.com>
Tue, 3 Mar 2020 02:32:40 +0000 (10:32 +0800)
committerFeng Xue <fxue@os.amperecomputing.com>
Mon, 1 Jun 2020 08:58:17 +0000 (16:58 +0800)
2020-06-01  Feng Xue  <fxue@os.amperecomputing.com>

gcc/
* cgraphclones.c (materialize_all_clones): Adjust replace map dump.
* ipa-param-manipulation.c (ipa_dump_adjusted_parameters): Do not
dump infomation if there is no adjusted parameter.
* (ipa_param_adjustments::dump): Adjust prefix spaces for dump string.

gcc/cgraphclones.c
gcc/ipa-param-manipulation.c

index e4f1c1d4b5ebbf8549d52ac19a3d1d9887242070..db61c218297a7448910a380ec61accc6ae9a5a81 100644 (file)
@@ -1160,15 +1160,15 @@ symbol_table::materialize_all_clones (void)
                      if (node->clone.tree_map)
                        {
                          unsigned int i;
-                         fprintf (symtab->dump_file, "   replace map: ");
+                         fprintf (symtab->dump_file, "    replace map:");
                          for (i = 0;
                               i < vec_safe_length (node->clone.tree_map);
                               i++)
                            {
                              ipa_replace_map *replace_info;
                              replace_info = (*node->clone.tree_map)[i];
-                             fprintf (symtab->dump_file, "%i -> ",
-                                      (*node->clone.tree_map)[i]->parm_num);
+                             fprintf (symtab->dump_file, "%s %i -> ",
+                                      i ? "," : "", replace_info->parm_num);
                              print_generic_expr (symtab->dump_file,
                                                  replace_info->new_tree);
                            }
index 978916057f07038f2949475d22db5d08c5f521cb..2cc4bc79dc1d2822ca21264b1abbbd876631d207 100644 (file)
@@ -111,6 +111,9 @@ ipa_dump_adjusted_parameters (FILE *f,
   unsigned i, len = vec_safe_length (adj_params);
   bool first = true;
 
+  if (!len)
+    return;
+
   fprintf (f, "    IPA adjusted parameters: ");
   for (i = 0; i < len; i++)
     {
@@ -899,7 +902,7 @@ ipa_param_adjustments::dump (FILE *f)
   fprintf (f, "    m_always_copy_start: %i\n", m_always_copy_start);
   ipa_dump_adjusted_parameters (f, m_adj_params);
   if (m_skip_return)
-    fprintf (f, "     Will SKIP return.\n");
+    fprintf (f, "    Will SKIP return.\n");
 }
 
 /* Dump information contained in the object in textual form to stderr.  */