Cleanup path solver dumps.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 9 Nov 2021 09:43:25 +0000 (10:43 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 9 Nov 2021 13:29:22 +0000 (14:29 +0100)
This patch makes the path solver dumps a bit more consistent.

Tested on x86-64 Linux.

gcc/ChangeLog:

* gimple-range-path.cc (path_range_query::dump): Clean up.
(path_range_query::compute_ranges): Same.
* value-relation.cc (path_oracle::dump): Same.

gcc/gimple-range-path.cc
gcc/value-relation.cc

index 52de103..99ac947 100644 (file)
@@ -98,7 +98,6 @@ path_range_query::dump (FILE *dump_file)
   unsigned i;
   bitmap_iterator bi;
 
-  fprintf (dump_file, "\nPath is (length=%d):\n", m_path->length ());
   dump_ranger (dump_file, *m_path);
 
   fprintf (dump_file, "Imports:\n");
@@ -505,7 +504,7 @@ path_range_query::compute_ranges (const vec<basic_block> &path,
                                  const bitmap_head *imports)
 {
   if (DEBUG_SOLVER)
-    fprintf (dump_file, "\n*********** path_range_query ******************\n");
+    fprintf (dump_file, "\n==============================================\n");
 
   set_path (path);
   bitmap_copy (m_imports, imports);
@@ -519,13 +518,13 @@ path_range_query::compute_ranges (const vec<basic_block> &path,
 
   if (DEBUG_SOLVER)
     {
-      fprintf (dump_file, "\npath_range_query: compute_ranges for path: ");
+      fprintf (dump_file, "path_range_query: compute_ranges for path: ");
       for (unsigned i = path.length (); i > 0; --i)
        {
          basic_block bb = path[i - 1];
-         fprintf (dump_file, "BB %d", bb->index);
+         fprintf (dump_file, "%d", bb->index);
          if (i > 1)
-           fprintf (dump_file, "");
+           fprintf (dump_file, "->");
        }
       fprintf (dump_file, "\n");
     }
@@ -557,9 +556,7 @@ path_range_query::compute_ranges (const vec<basic_block> &path,
 
   if (DEBUG_SOLVER)
     {
-      fprintf (dump_file, "\npath_oracle:\n");
       get_path_oracle ()->dump (dump_file);
-      fprintf (dump_file, "\n");
       dump (dump_file);
     }
 }
index a010548..9c3ecd9 100644 (file)
@@ -1448,10 +1448,14 @@ void
 path_oracle::dump (FILE *f) const
 {
   equiv_chain *ptr = m_equiv.m_next;
+  relation_chain *ptr2 = m_relations.m_head;
+
+  if (ptr || ptr2)
+    fprintf (f, "\npath_oracle:\n");
+
   for (; ptr; ptr = ptr->m_next)
     ptr->dump (f);
 
-  relation_chain *ptr2 = m_relations.m_head;
   for (; ptr2; ptr2 = ptr2->m_next)
     {
       fprintf (f, "Relational : ");