Add -fopt-info-loop support for interchange.

Message ID alpine.LSU.2.20.1712081222480.12252@zhemvz.fhfr.qr
State New
Headers show
Series
  • Add -fopt-info-loop support for interchange.
Related show

Commit Message

Richard Biener Dec. 8, 2017, 11:23 a.m.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-12-08  Richard Biener  <rguenther@suse.de>

	* gimple-loop-interchange.cc (tree_loop_interchange::interchange):
	Provide -fopt-info-loop feedback when we interchange in a nest.

Patch

Index: gcc/gimple-loop-interchange.cc
===================================================================
--- gcc/gimple-loop-interchange.cc	(revision 255499)
+++ gcc/gimple-loop-interchange.cc	(working copy)
@@ -1550,6 +1550,7 @@  bool
 tree_loop_interchange::interchange (vec<data_reference_p> datarefs,
 				    vec<ddr_p> ddrs)
 {
+  location_t loc = find_loop_location (m_loop_nest[0]);
   bool changed_p = false;
   /* In each iteration we try to interchange I-th loop with (I+1)-th loop.
      The overall effect is to push inner loop to outermost level in whole
@@ -1597,8 +1598,12 @@  tree_loop_interchange::interchange (vec<
 		     oloop.m_loop->num, iloop.m_loop->num);
 	}
     }
-
   simple_dce_from_worklist (m_dce_seeds);
+
+  if (changed_p)
+    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
+		     "loops interchanged in loop nest\n");
+
   return changed_p;
 }