[10/10] Experiment with optinfo in tree-ssa-loop-im.c

Message ID 1527626483-4723-11-git-send-email-dmalcolm@redhat.com
State New
Headers show
Series
  • RFC: Prototype of compiler-assisted performance analysis
Related show

Commit Message

David Malcolm May 29, 2018, 8:41 p.m.
---
 gcc/tree-ssa-loop-im.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

-- 
1.8.5.3

Patch

diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 030aac0..fcf5d24 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -45,6 +45,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "gimple-fold.h"
 #include "tree-scalar-evolution.h"
 #include "tree-ssa-loop-niter.h"
+#include "optinfo.h"
 
 /* TODO:  Support for predicated code motion.  I.e.
 
@@ -1125,6 +1126,12 @@  move_computations_worker (basic_block bb)
 	  fprintf (dump_file, "(cost %u) out of loop %d.\n\n",
 		   cost, level->num);
 	}
+      /* FIXME.  */
+      if (optinfo_enabled_p ())
+	OPTINFO_SUCCESS (stmt)
+	  << "moving PHI node "
+	  << stmt
+	  << optinfo_printf (" (cost %u) out of loop %d", cost, level->num);
 
       if (gimple_phi_num_args (stmt) == 1)
 	{
@@ -1194,6 +1201,12 @@  move_computations_worker (basic_block bb)
 	  fprintf (dump_file, "(cost %u) out of loop %d.\n\n",
 		   cost, level->num);
 	}
+      /* FIXME.  */
+      if (optinfo_enabled_p ())
+	OPTINFO_SUCCESS (stmt)
+	  << "moving statement "
+	  << stmt
+	  << optinfo_printf (" (cost %u) out of loop %d", cost, level->num);
 
       e = loop_preheader_edge (level);
       gcc_assert (!gimple_vdef (stmt));