Doing so makes this information appear in -fopt-info, remarks,
and optimization records, rather than just in the dump_file.

gcc/ChangeLog:
        * gimple-loop-interchange.cc (tree_loop_interchange::interchange):
        Convert fprintf calls to dump_printf calls.
        (prepare_perfect_loop_nest): Likewise.
---
 gcc/gimple-loop-interchange.cc | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc
index ef8df28..b40ee4b 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -1627,11 +1627,10 @@ tree_loop_interchange::interchange 
(vec<data_reference_p> datarefs,
                                    (unsigned) stmt_cost,
                                    iloop.m_loop->inner == NULL))
        {
-         if (dump_file && (dump_flags & TDF_DETAILS))
-           fprintf (dump_file,
-                    "Loop_pair<outer:%d, inner:%d> is interchanged\n\n",
-                    oloop.m_loop->num, iloop.m_loop->num);
-
+         if (dump_enabled_p ())
+           dump_printf (MSG_OPTIMIZED_LOCATIONS |TDF_DETAILS,
+                        "Loop_pair<outer:%d, inner:%d> is interchanged\n\n",
+                        oloop.m_loop->num, iloop.m_loop->num);
          changed_p = true;
          interchange_loops (iloop, oloop);
          /* No need to update if there is no further loop interchange.  */
@@ -1640,10 +1639,10 @@ tree_loop_interchange::interchange 
(vec<data_reference_p> datarefs,
        }
       else
        {
-         if (dump_file && (dump_flags & TDF_DETAILS))
-           fprintf (dump_file,
-                    "Loop_pair<outer:%d, inner:%d> is not interchanged\n\n",
-                    oloop.m_loop->num, iloop.m_loop->num);
+         if (dump_enabled_p ())
+           dump_printf (MSG_MISSED_OPTIMIZATION |TDF_DETAILS,
+                        "Loop_pair<outer:%d, inner:%d> is not 
interchanged\n\n",
+                        oloop.m_loop->num, iloop.m_loop->num);
        }
     }
   simple_dce_from_worklist (m_dce_seeds);
@@ -2028,10 +2027,10 @@ prepare_perfect_loop_nest (struct loop *loop, 
vec<loop_p> *loop_nest,
     if (find_loop_nest (start_loop, loop_nest)
        && tree_loop_interchange_compute_ddrs (*loop_nest, *datarefs, ddrs))
       {
-       if (dump_file && (dump_flags & TDF_DETAILS))
-         fprintf (dump_file,
-                  "\nConsider loop interchange for loop_nest<%d - %d>\n",
-                  start_loop->num, innermost->num);
+       if (dump_enabled_p ())
+         dump_printf (MSG_NOTE |TDF_DETAILS,
+                      "\nConsider loop interchange for loop_nest<%d - %d>\n",
+                      start_loop->num, innermost->num);
 
        if (loop != start_loop)
          prune_access_strides_not_in_loop (start_loop, innermost, *datarefs);
-- 
1.8.5.3

Reply via email to