From f273bbbd5e41667c76dd7777165d949c97dcf7eb Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 15 May 2018 13:21:46 -0400
Subject: [PATCH 45/83] Use VECT_OPTINFO_SCOPE more; various cleanups

---
 gcc/tree-vect-data-refs.c  | 40 +++++++++++----------------------
 gcc/tree-vect-loop-manip.c |  4 +---
 gcc/tree-vect-loop.c       | 45 +++++++++++--------------------------
 gcc/tree-vect-patterns.c   |  4 +---
 gcc/tree-vect-slp.c        | 55 +++++++++++++++++++---------------------------
 gcc/tree-vect-stmts.c      | 33 ++++++++--------------------
 gcc/tree-vectorizer.c      |  2 +-
 7 files changed, 61 insertions(+), 122 deletions(-)

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index c55d30a..f40ce9c 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -544,9 +544,7 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo,
   unsigned int i;
   struct data_dependence_relation *ddr;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_analyze_data_ref_dependences ===";
+  VECT_OPTINFO_SCOPE ("vect_analyze_data_ref_dependences");
 
   LOOP_VINFO_DDRS (loop_vinfo)
     .create (LOOP_VINFO_DATAREFS (loop_vinfo).length ()
@@ -712,9 +710,7 @@ vect_slp_analyze_node_dependences (slp_instance instance, slp_tree node,
 bool
 vect_slp_analyze_instance_dependence (slp_instance instance)
 {
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_slp_analyze_instance_dependence ===";
+  VECT_OPTINFO_SCOPE ("vect_slp_analyze_instance_dependence");
 
   /* The stores of this instance are at the root of the SLP tree.  */
   slp_tree store = SLP_INSTANCE_TREE (instance);
@@ -1641,9 +1637,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
   unsigned int mis, same_align_drs_max = 0;
   hash_table<peel_info_hasher> peeling_htab (1);
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-                     "=== vect_enhance_data_refs_alignment ===\n");
+  VECT_OPTINFO_SCOPE ("vect_enhance_data_refs_alignment");
 
   /* Reset data so we can safely be called multiple times.  */
   LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo).truncate (0);
@@ -2299,9 +2293,7 @@ vect_find_same_alignment_drs (struct data_dependence_relation *ddr)
 bool
 vect_analyze_data_refs_alignment (loop_vec_info vinfo)
 {
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-                     "=== vect_analyze_data_refs_alignment ===");
+  VECT_OPTINFO_SCOPE ("vect_analyze_data_refs_alignment");
 
   /* Mark groups of data references with same alignment using
      data dependence information.  */
@@ -2329,9 +2321,9 @@ vect_analyze_data_refs_alignment (loop_vec_info vinfo)
 	    continue;
 
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "not vectorized: can't calculate alignment "
-			     "for data ref.\n");
+	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      << ("not vectorized: can't calculate alignment "
+		  "for data ref");
 
 	  return false;
 	}
@@ -2363,9 +2355,9 @@ vect_slp_analyze_and_verify_node_alignment (slp_tree node)
       || ! verify_data_ref_alignment (dr))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			 "not vectorized: bad data alignment in basic "
-			 "block.\n");
+	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  << ("not vectorized: bad data alignment in basic "
+	      "block");
       return false;
     }
 
@@ -2380,9 +2372,7 @@ vect_slp_analyze_and_verify_node_alignment (slp_tree node)
 bool
 vect_slp_analyze_and_verify_instance_alignment (slp_instance instance)
 {
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-                     "=== vect_slp_analyze_and_verify_instance_alignment ===\n");
+  VECT_OPTINFO_SCOPE ("vect_slp_analyze_and_verify_instance_alignment");
 
   slp_tree node;
   unsigned i;
@@ -2885,9 +2875,7 @@ vect_analyze_data_ref_accesses (vec_info *vinfo)
   vec<data_reference_p> datarefs = vinfo->datarefs;
   struct data_reference *dr;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-                     "=== vect_analyze_data_ref_accesses ===\n");
+  VECT_OPTINFO_SCOPE ("vect_analyze_data_ref_accesses");
 
   if (datarefs.is_empty ())
     return true;
@@ -3332,9 +3320,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
   unsigned int i;
   tree length_factor;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-                     "=== vect_prune_runtime_alias_test_list ===\n");
+  VECT_OPTINFO_SCOPE ("vect_prune_runtime_alias_test_list");
 
   /* Step values are irrelevant for aliasing if the number of vector
      iterations is equal to the number of scalar iterations (which can
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index e82c1fe..afec018 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1733,9 +1733,7 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters,
   vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
   struct data_reference *dr;
 
-  if (dump_enabled_p ())
-    dump_printf_loc (MSG_NOTE, vect_location,
-		     "=== vect_update_inits_of_dr ===\n");
+  VECT_OPTINFO_SCOPE ("vect_update_inits_of_dr");
 
   /* Adjust niters to sizetype and insert stmts on loop preheader edge.  */
   if (!types_compatible_p (sizetype, TREE_TYPE (niters)))
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 9e2fe9c..71c66de 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -216,9 +216,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
   bool bool_result;
   auto_vec<stmt_vec_info> mask_producers;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_determine_vectorization_factor ===";
+  VECT_OPTINFO_SCOPE ("vect_determine_vectorization_factor");
 
   for (i = 0; i < nbbs; i++)
     {
@@ -774,9 +772,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
   gphi_iterator gsi;
   bool double_reduc;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_analyze_scalar_cycles ===";
+  VECT_OPTINFO_SCOPE ("vect_analyze_scalar_cycles");
 
   /* First - identify all inductions.  Reduction detection assumes that all the
      inductions have been identified, therefore, this order must not be
@@ -1020,9 +1016,8 @@ vect_get_loop_niters (struct loop *loop, tree *assumptions,
   *assumptions = boolean_true_node;
   *number_of_iterationsm1 = chrec_dont_know;
   *number_of_iterations = chrec_dont_know;
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== get_loop_niters ===";
+
+  VECT_OPTINFO_SCOPE ("get_loop_niters");
 
   if (!exit)
     return cond;
@@ -1461,9 +1456,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
 			  tree *assumptions, tree *number_of_iterationsm1,
 			  tree *number_of_iterations, gcond **inner_loop_cond)
 {
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_analyze_loop_form ===";
+  VECT_OPTINFO_SCOPE ("vect_analyze_loop_form");
 
   /* Different restrictions apply when we are considering an inner-most loop,
      vs. an outer (nested) loop.
@@ -1706,9 +1699,7 @@ vect_update_vf_for_slp (loop_vec_info loop_vinfo)
   poly_uint64 vectorization_factor;
   int i;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_update_vf_for_slp ===";
+  VECT_OPTINFO_SCOPE ("vect_update_vf_for_slp");
 
   vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
   gcc_assert (known_ne (vectorization_factor, 0U));
@@ -1813,9 +1804,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
   bool need_to_vectorize = false;
   bool ok;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vect_analyze_loop_operations ===";
+  VECT_OPTINFO_SCOPE ("vect_analyze_loop_operations");
 
   for (i = 0; i < nbbs; i++)
     {
@@ -1831,8 +1820,8 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
           if (optinfo_enabled_p ())
             {
               EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-		<< "examining phi: ";
-              dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
+		<< "examining phi: "
+		<< phi;
             }
 	  if (virtual_operand_p (gimple_phi_result (phi)))
 	    continue;
@@ -2571,9 +2560,7 @@ vect_analyze_loop (struct loop *loop, loop_vec_info orig_loop_vinfo)
   targetm.vectorize.autovectorize_vector_sizes (&vector_sizes);
   unsigned int next_size = 0;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "===== analyze_loop_nest =====";
+  VECT_OPTINFO_SCOPE ("analyze_loop_nest");
 
   if (loop_outer (loop)
       && loop_vec_info_for_loop (loop_outer (loop))
@@ -7721,9 +7708,7 @@ vectorizable_induction (gimple *phi,
   if (!vec_stmt) /* transformation not required.  */
     {
       STMT_VINFO_TYPE (stmt_info) = induc_vec_info_type;
-      if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-	  << "=== vectorizable_induction ===";
+      VECT_OPTINFO_SCOPE ("vectorizable_induction");
       vect_model_induction_cost (stmt_info, ncopies);
       return true;
     }
@@ -8595,9 +8580,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
   bool check_profitability = false;
   unsigned int th;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-      << "=== vec_transform_loop ===";
+  VECT_OPTINFO_SCOPE ("vec_transform_loop");
 
   /* Use the more conservative vectorization threshold.  If the number
      of iterations is constant assume the cost check has been performed
@@ -8878,9 +8861,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 		{
 		  slp_scheduled = true;
 
-		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
-		      << "=== scheduling SLP instances ===";
+		  VECT_OPTINFO_SCOPE ("scheduling SLP instances");
 
 		  vect_schedule_slp (loop_vinfo);
 		}
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 621ed07..aade8f0 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -4660,9 +4660,7 @@ vect_pattern_recog (vec_info *vinfo)
   auto_vec<gimple *, 1> stmts_to_replace;
   gimple *stmt;
 
-  if (dump_enabled_p ())
-    dump_printf_loc (MSG_NOTE, vect_location,
-                     "=== vect_pattern_recog ===\n");
+  VECT_OPTINFO_SCOPE ("vect_pattern_recog");
 
   if (loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo))
     {
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 887a874..ce23d01 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2416,8 +2416,7 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
   unsigned int i;
   gimple *first_element;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "=== vect_analyze_slp ===\n");
+  VECT_OPTINFO_SCOPE ("vect_analyze_slp");
 
   /* Find SLP sequences starting from groups of grouped stores.  */
   FOR_EACH_VEC_ELT (vinfo->grouped_stores, i, first_element)
@@ -2470,9 +2469,7 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
   slp_instance instance;
   int decided_to_slp = 0;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "=== vect_make_slp_decision ==="
-                     "\n");
+  VECT_OPTINFO_SCOPE ("vect_make_slp_decision");
 
   FOR_EACH_VEC_ELT (slp_instances, i, instance)
     {
@@ -2638,9 +2635,7 @@ vect_detect_hybrid_slp (loop_vec_info loop_vinfo)
   vec<slp_instance> slp_instances = LOOP_VINFO_SLP_INSTANCES (loop_vinfo);
   slp_instance instance;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "=== vect_detect_hybrid_slp ==="
-                     "\n");
+  VECT_OPTINFO_SCOPE ("vect_detect_hybrid_slp");
 
   /* First walk all pattern stmt in the loop and mark defs of uses as
      hybrid because immediate uses in them are not recorded.  */
@@ -2847,9 +2842,7 @@ vect_slp_analyze_operations (vec_info *vinfo)
   slp_instance instance;
   int i;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-		     "=== vect_slp_analyze_operations ===\n");
+  VECT_OPTINFO_SCOPE ("vect_slp_analyze_operations");
 
   for (i = 0; vinfo->slp_instances.iterate (i, &instance); )
     {
@@ -2857,11 +2850,9 @@ vect_slp_analyze_operations (vec_info *vinfo)
 					     SLP_INSTANCE_TREE (instance),
 					     instance))
         {
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-			   "removing SLP instance operations starting from: ");
-	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
-			    SLP_TREE_SCALAR_STMTS
-			      (SLP_INSTANCE_TREE (instance))[0], 0);
+	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    << "removing SLP instance operations starting from: "
+	    << SLP_TREE_SCALAR_STMTS (SLP_INSTANCE_TREE (instance))[0];
 	  vect_free_slp_instance (instance);
           vinfo->slp_instances.ordered_remove (i);
 	}
@@ -2869,15 +2860,15 @@ vect_slp_analyze_operations (vec_info *vinfo)
 	i++;
     }
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-		     "=== vect_analyze_slp_cost ===\n");
+  {
+    VECT_OPTINFO_SCOPE ("vect_analyze_slp_cost");
 
-  /* Compute the costs of the SLP instances.  */
-  scalar_stmts_set_t *visited = new scalar_stmts_set_t ();
-  for (i = 0; vinfo->slp_instances.iterate (i, &instance); ++i)
-    vect_analyze_slp_cost (instance, vinfo->target_cost_data, visited);
-  delete visited;
+    /* Compute the costs of the SLP instances.  */
+    scalar_stmts_set_t *visited = new scalar_stmts_set_t ();
+    for (i = 0; vinfo->slp_instances.iterate (i, &instance); ++i)
+      vect_analyze_slp_cost (instance, vinfo->target_cost_data, visited);
+    delete visited;
+  }
 
   return !vinfo->slp_instances.is_empty ();
 }
@@ -3195,8 +3186,7 @@ vect_slp_bb (basic_block bb)
   bool any_vectorized = false;
   auto_vector_sizes vector_sizes;
 
-  if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "===vect_slp_analyze_bb===");
+  VECT_OPTINFO_SCOPE ("vect_slp_analyze_bb");
 
   /* Autodetect first vector size we try.  */
   current_vector_size = 0;
@@ -3249,13 +3239,14 @@ vect_slp_bb (basic_block bb)
 	  && dbg_cnt (vect_slp))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "SLPing BB part\n");
+	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      << "SLPing BB part";
 
 	  vect_schedule_slp (bb_vinfo);
 
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-			     "basic block part vectorized\n");
+	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      << "basic block part vectorized";
 
 	  vectorized = true;
 	}
@@ -3293,9 +3284,9 @@ vect_slp_bb (basic_block bb)
 	  current_vector_size = vector_sizes[next_size++];
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
-			       "***** Re-trying analysis with "
-			       "vector size ");
+	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		<< "***** Re-trying analysis with vector size ";
+	      // FIXME:
 	      dump_dec (MSG_NOTE, current_vector_size);
 	      dump_printf (MSG_NOTE, "\n");
 	    }
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index f8782f5..00445cd 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -633,9 +633,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
   bool live_p;
   enum vect_relevant relevant;
 
-  if (optinfo_enabled_p ())
-    dump_printf_loc (MSG_NOTE, vect_location,
-                     "=== vect_mark_stmts_to_be_vectorized ===\n");
+  VECT_OPTINFO_SCOPE ("vect_mark_stmts_to_be_vectorized");
 
   auto_vec<gimple *, 64> worklist;
 
@@ -2886,9 +2884,8 @@ vectorizable_bswap (gimple *stmt, gimple_stmt_iterator *gsi,
   if (! vec_stmt)
     {
       STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
-      if (optinfo_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location, "=== vectorizable_bswap ==="
-                         "\n");
+
+      VECT_OPTINFO_SCOPE ("vectorizable_bswap");
       if (! slp_node)
 	{
 	  add_stmt_cost (stmt_info->vinfo->target_cost_data,
@@ -3205,9 +3202,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   if (!vec_stmt) /* transformation not required.  */
     {
       STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
-      if (optinfo_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location, "=== vectorizable_call ==="
-                         "\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_call");
       if (!slp_node)
 	{
 	  vect_model_simple_cost (stmt_info, ncopies, dt, ndts, NULL, NULL);
@@ -3884,9 +3879,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
 	    STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (sll);
 	  }
       STMT_VINFO_TYPE (stmt_info) = call_simd_clone_vec_info_type;
-      if (optinfo_enabled_p ())
-	dump_printf_loc (MSG_NOTE, vect_location,
-			 "=== vectorizable_simd_clone_call ===\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_simd_clone_call");
 /*      vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL); */
       return true;
     }
@@ -4736,9 +4729,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
 
   if (!vec_stmt)		/* transformation not required.  */
     {
-      if (optinfo_enabled_p ())
-	dump_printf_loc (MSG_NOTE, vect_location,
-                         "=== vectorizable_conversion ===\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_conversion");
       if (code == FIX_TRUNC_EXPR || code == FLOAT_EXPR)
         {
 	  STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
@@ -5149,9 +5140,7 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vec_stmt) /* transformation not required.  */
     {
       STMT_VINFO_TYPE (stmt_info) = assignment_vec_info_type;
-      if (optinfo_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location,
-                         "=== vectorizable_assignment ===\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_assignment");
       if (!slp_node)
 	vect_model_simple_cost (stmt_info, ncopies, dt, ndts, NULL, NULL);
       return true;
@@ -5514,9 +5503,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vec_stmt) /* transformation not required.  */
     {
       STMT_VINFO_TYPE (stmt_info) = shift_vec_info_type;
-      if (optinfo_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location,
-                         "=== vectorizable_shift ===\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_shift");
       if (!slp_node)
 	vect_model_simple_cost (stmt_info, ncopies, dt, ndts, NULL, NULL);
       return true;
@@ -5838,9 +5825,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vec_stmt) /* transformation not required.  */
     {
       STMT_VINFO_TYPE (stmt_info) = op_vec_info_type;
-      if (optinfo_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location,
-                         "=== vectorizable_operation ===\n");
+      VECT_OPTINFO_SCOPE ("vectorizable_operation");
       if (!slp_node)
 	vect_model_simple_cost (stmt_info, ncopies, dt, ndts, NULL, NULL);
       return true;
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 492ffff..eeb34c6 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -663,7 +663,7 @@ vectorize_loops (void)
 	  dump_printf (MSG_NOTE, "\nAnalyzing loop at %s:%d\n",
                        LOCATION_FILE (vect_location),
 		       LOCATION_LINE (vect_location));
-	OPTINFO_REMARK (loop) << "analyzing loop";
+	VECT_OPTINFO_SCOPE ("analyzing loop");
 
 	loop_vinfo = vect_analyze_loop (loop, orig_loop_vinfo);
 	loop->aux = loop_vinfo;
-- 
1.8.5.3

