From b6c03f36147ed00aa419a6d8a34d14151308576d Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 15 May 2018 14:00:43 -0400
Subject: [PATCH 47/67] Get rid of EMIT_OPTINFO_AT_VECT_LOCATION in favor of 3
 shorter macros

---
 gcc/tree-vect-data-refs.c | 235 +++++++++++++++++----------------
 gcc/tree-vect-loop.c      | 326 +++++++++++++++++++++++-----------------------
 gcc/tree-vect-slp.c       | 139 ++++++++++----------
 gcc/tree-vect-stmts.c     | 205 ++++++++++++++---------------
 gcc/tree-vectorizer.h     |  18 ++-
 5 files changed, 466 insertions(+), 457 deletions(-)

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 89f66bc..9978de3 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -73,7 +73,7 @@ vect_lanes_optab_supported_p (const char *name, convert_optab optab,
       if (!int_mode_for_size (bits, limit_p).exists (&array_mode))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << optinfo_printf ("no array mode for %s["
 				 HOST_WIDE_INT_PRINT_DEC "]",
 				 GET_MODE_NAME (mode), count);
@@ -84,14 +84,14 @@ vect_lanes_optab_supported_p (const char *name, convert_optab optab,
   if (convert_optab_handler (optab, array_mode, mode) == CODE_FOR_nothing)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << optinfo_printf ("cannot use %s<%s><%s>", name,
 			     GET_MODE_NAME (array_mode), GET_MODE_NAME (mode));
       return false;
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << optinfo_printf ("can use %s<%s><%s>", name,
 			 GET_MODE_NAME (array_mode),
 			 GET_MODE_NAME (mode));
@@ -184,7 +184,7 @@ vect_check_nonzero_value (loop_vec_info loop_vinfo, tree value)
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "need run-time check that "
 	<< slim (value)
 	<< " is nonzero";
@@ -342,7 +342,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      OPTINFO_VECT_FAILURE
 		<< ("versioning for alias not supported for: "
 		    "can't determine dependence between ")
 		<< slim (DR_REF (dra))
@@ -354,7 +354,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << ("versioning for alias required: "
 		"can't determine dependence between ")
 	    << slim (DR_REF (dra))
@@ -384,7 +384,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      OPTINFO_VECT_FAILURE
 		<< ("versioning for alias not supported for: "
 		    "bad dist vector for ")
 		<< slim (DR_REF (dra))
@@ -396,7 +396,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+          OPTINFO_VECT_FAILURE
 	    << ("versioning for alias required: "
 		"bad dist vector for ")
 	    << slim (DR_REF (dra))
@@ -419,14 +419,14 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
       int dist = dist_v[loop_depth];
 
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << optinfo_printf ("dependence distance  = %d", dist);
 
       if (dist == 0)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "dependence distance == 0 between "
 		<< slim (DR_REF (dra))
 		<< " and "
@@ -454,7 +454,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	  if (!vect_preserves_scalar_order_p (DR_STMT (dra), DR_STMT (drb)))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "READ_WRITE dependence in interleaving";
 	      return true;
 	    }
@@ -467,7 +467,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	      else if (integer_zerop (indicator))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		    OPTINFO_VECT_FAILURE
 		      << "access also has a zero step";
 		  return true;
 		}
@@ -481,7 +481,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	     reversed (to make distance vector positive), and the actual
 	     distance is negative.  */
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "dependence distance negative";
 	  /* Record a negative dependence distance to later limit the
 	     amount of stmt copying / unrolling we can perform.
@@ -500,7 +500,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	     vectorization factor.  */
 	  *max_vf = abs (dist);
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << optinfo_printf ("adjusting maximal vectorization factor to %i",
 				 *max_vf);
 	}
@@ -510,14 +510,14 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	  /* Dependence distance does not create dependence, as far as
 	     vectorization is concerned, in this case.  */
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << optinfo_printf ("dependence distance >= VF");
 	  continue;
 	}
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << ("not vectorized, possible dependence "
 		"between data-refs ")
 	    << slim (DR_REF (dra))
@@ -609,7 +609,7 @@ vect_slp_analyze_data_ref_dependence (struct data_dependence_relation *ddr)
     {
       if  (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << "can't determine dependence between "
 	    << slim (DR_REF (dra))
 	    << " and "
@@ -618,7 +618,7 @@ vect_slp_analyze_data_ref_dependence (struct data_dependence_relation *ddr)
     }
   else if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "determined dependence between "
 	<< slim (DR_REF (dra))
 	<< " and "
@@ -770,7 +770,7 @@ vect_record_base_alignment (vec_info *vinfo, gimple *stmt,
       entry = drb;
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "recording new base alignment for "
 	    << slim (drb->base_address)
 	    << "\n"
@@ -849,7 +849,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
   tree vectype = STMT_VINFO_VECTYPE (stmt_info);
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << "vect_compute_data_ref_alignment:";
 
   if (loop_vinfo)
@@ -886,10 +886,10 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
       if (optinfo_enabled_p ())
 	{
 	  if (step_preserves_misalignment_p)
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	    OPTINFO_VECT_REMARK << optinfo_printf (
 			     "inner step divides the vector alignment.\n");
 	  else
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "inner step doesn't divide the vector"
 			     " alignment.\n");
 	}
@@ -906,7 +906,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 	= multiple_p (DR_STEP_ALIGNMENT (dr) * vf, vector_alignment);
 
       if (!step_preserves_misalignment_p && optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	OPTINFO_VECT_FAILURE << (
 			 "step doesn't divide the vector alignment.\n");
     }
 
@@ -930,7 +930,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	  OPTINFO_VECT_FAILURE << (
 	                   "Unknown alignment for access: ");
 	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, ref);
 	  dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -948,7 +948,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	      OPTINFO_VECT_REMARK << optinfo_printf (
 	                       "can't force alignment of ref: ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM, ref);
 	      dump_printf (MSG_NOTE, "\n");
@@ -961,7 +961,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 	 the analysis phase, before deciding to vectorize the loop.  */
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "force alignment of ");
+          OPTINFO_VECT_REMARK << optinfo_printf ( "force alignment of ");
           dump_generic_expr (MSG_NOTE, TDF_SLIM, ref);
           dump_printf (MSG_NOTE, "\n");
         }
@@ -986,7 +986,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 			   &const_misalignment))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "Non-constant misalignment for access: "
 	  << slim (ref);
       return true;
@@ -995,7 +995,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
   SET_DR_MISALIGNMENT (dr, const_misalignment);
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+    OPTINFO_VECT_FAILURE
       << optinfo_printf ("misalign = %d bytes of ref ", DR_MISALIGNMENT (dr))
       << slim (ref);
 
@@ -1061,7 +1061,7 @@ vect_update_misalignment_for_peel (struct data_reference *dr,
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "Setting misalignment " \
+    OPTINFO_VECT_REMARK << optinfo_printf ( "Setting misalignment " \
 		     "to unknown (-1).\n");
   SET_DR_MISALIGNMENT (dr, DR_MISALIGNMENT_UNKNOWN);
 }
@@ -1081,10 +1081,10 @@ verify_data_ref_alignment (data_reference_p dr)
       if (optinfo_enabled_p ())
 	{
 	  if (DR_IS_READ (dr))
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "not vectorized: unsupported unaligned load.");
 	  else
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "not vectorized: unsupported unaligned "
 			     "store.");
 
@@ -1096,7 +1096,7 @@ verify_data_ref_alignment (data_reference_p dr)
     }
 
   if (supportable_dr_alignment != dr_aligned && optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+    OPTINFO_VECT_REMARK << optinfo_printf (
 		     "Vectorizing an unaligned access.\n");
 
   return true;
@@ -1193,7 +1193,7 @@ vector_alignment_reachable_p (struct data_reference *dr)
 		int_cst_value (TYPE_SIZE_UNIT (TREE_TYPE (vectype)));
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 	                   "data size =" HOST_WIDE_INT_PRINT_DEC, elmsize);
 	  dump_printf (MSG_NOTE,
 	               ". misalignment = %d.\n", DR_MISALIGNMENT (dr));
@@ -1201,7 +1201,7 @@ vector_alignment_reachable_p (struct data_reference *dr)
       if (DR_MISALIGNMENT (dr) % elmsize)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 	                     "data size does not divide the misalignment.\n");
 	  return false;
 	}
@@ -1212,7 +1212,7 @@ vector_alignment_reachable_p (struct data_reference *dr)
       tree type = TREE_TYPE (DR_REF (dr));
       bool is_packed = not_size_aligned (DR_REF (dr));
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << optinfo_printf ("Unknown misalignment, %snaturally aligned\n",
 			     is_packed ? "not " : "");
       return targetm.vectorize.vector_alignment_reachable (type, is_packed);
@@ -1247,7 +1247,7 @@ vect_get_data_access_cost (struct data_reference *dr,
     vect_get_store_cost (dr, ncopies, inside_cost, body_cost_vec);
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+    OPTINFO_VECT_REMARK << optinfo_printf (
                      "vect_get_data_access_cost: inside_cost = %d, "
                      "outside_cost = %d.\n", *inside_cost, *outside_cost);
 }
@@ -1802,7 +1802,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
           if (!aligned_access_p (dr))
             {
               if (optinfo_enabled_p ())
-                EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+                OPTINFO_VECT_FAILURE << (
                                  "vector alignment may not be reachable\n");
               break;
             }
@@ -1996,7 +1996,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
 	    npeel /= GROUP_SIZE (stmt_info);
 
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+            OPTINFO_VECT_REMARK << optinfo_printf (
                              "Try peeling by %d\n", npeel);
         }
 
@@ -2031,7 +2031,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
                 {
                   do_peeling = false;
                   if (optinfo_enabled_p ())
-                    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+                    OPTINFO_VECT_REMARK << optinfo_printf (
                         "Disable peeling, max peels reached: %d\n", max_peel);
                 }
             }
@@ -2082,9 +2082,9 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
 	  SET_DR_MISALIGNMENT (dr0, 0);
 	  if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+              OPTINFO_VECT_REMARK << optinfo_printf (
                                "Alignment of access forced using peeling.\n");
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+              OPTINFO_VECT_REMARK << optinfo_printf (
                                "Peeling for alignment will be applied.\n");
             }
 
@@ -2206,12 +2206,12 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
           dr = STMT_VINFO_DATA_REF (stmt_info);
 	  SET_DR_MISALIGNMENT (dr, 0);
 	  if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+            OPTINFO_VECT_REMARK << optinfo_printf (
                              "Alignment of access forced using versioning.\n");
         }
 
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+        OPTINFO_VECT_REMARK << optinfo_printf (
                          "Versioning for alignment will be applied.\n");
 
       /* Peeling and versioning can't be done together at this time.  */
@@ -2275,7 +2275,7 @@ vect_find_same_alignment_drs (struct data_dependence_relation *ddr)
   STMT_VINFO_SAME_ALIGN_REFS (stmtinfo_b).safe_push (dra);
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+      OPTINFO_VECT_REMARK << optinfo_printf (
 		       "accesses have the same alignment: ");
       dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dra));
       dump_printf (MSG_NOTE,  " and ");
@@ -2321,7 +2321,7 @@ vect_analyze_data_refs_alignment (loop_vec_info vinfo)
 	    continue;
 
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("not vectorized: can't calculate alignment "
 		  "for data ref");
 
@@ -2355,7 +2355,7 @@ 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)
+	OPTINFO_VECT_FAILURE
 	  << ("not vectorized: bad data alignment in basic "
 	      "block");
       return false;
@@ -2426,7 +2426,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "Step "
 		<< slim (step)
 		<< " is not a multiple of the element size for "
@@ -2456,7 +2456,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	  GROUP_GAP (stmt_info) = groupsize - 1;
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "Detected single element interleaving "
 		<< slim (DR_REF (dr))
 		<< " step "
@@ -2468,9 +2468,9 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 
       if (optinfo_enabled_p ())
         {
- 	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-	                   "not consecutive access ");
-	  dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
+ 	  OPTINFO_VECT_FAILURE
+	    << "not consecutive access "
+	    << stmt;
         }
 
       if (bb_vinfo)
@@ -2480,7 +2480,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
           return true;
         }
 
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "using strided accesses";
       STMT_VINFO_STRIDED_P (stmt_info) = true;
       return true;
@@ -2510,13 +2510,13 @@ vect_analyze_group_access_1 (struct data_reference *dr)
               if (DR_IS_WRITE (data_ref))
                 {
                   if (optinfo_enabled_p ())
-                    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+                    OPTINFO_VECT_FAILURE
 		      << "Two store stmts share the same dr";
                   return false;
                 }
 
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "Two or more load stmts share the same dr";
 
               /* For load use the same data-ref load.  */
@@ -2544,7 +2544,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	      if (DR_IS_WRITE (data_ref))
 		{
                   if (optinfo_enabled_p ())
-                    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+                    OPTINFO_VECT_FAILURE
 		      << "interleaved store with gaps";
 		  return false;
 		}
@@ -2572,7 +2572,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
       if (groupsize > 4096)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "group is too large\n");
 	  return false;
 	}
@@ -2583,7 +2583,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	  && !DR_IS_READ (dr))
         {
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "interleaved store with gaps\n");
 	  return false;
 	}
@@ -2597,7 +2597,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
       GROUP_SIZE (vinfo_for_stmt (stmt)) = groupsize;
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "Detected interleaving ");
 	  if (DR_IS_READ (dr))
 	    dump_printf (MSG_NOTE, "load ");
@@ -2607,7 +2607,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 		       (unsigned)groupsize);
 	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
 	  if (GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	    OPTINFO_VECT_REMARK << optinfo_printf (
 			     "There is a gap of %u elements after the group\n",
 			     GROUP_GAP (vinfo_for_stmt (stmt)));
 	}
@@ -2675,7 +2675,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
   if (loop_vinfo && !step)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	OPTINFO_VECT_FAILURE << (
 	                 "bad data-ref access in loop\n");
       return false;
     }
@@ -2692,7 +2692,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
       if (loop->safelen < 2)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	    OPTINFO_VECT_REMARK << optinfo_printf (
 			     "zero step in inner loop of nest\n");
 	  return false;
 	}
@@ -2709,7 +2709,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
       if (integer_zerop (step))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	    OPTINFO_VECT_REMARK << optinfo_printf (
 	                     "zero step in outer loop.\n");
 	  return DR_IS_READ (dr);
 	}
@@ -2732,7 +2732,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
   if (loop && nested_in_vect_loop_p (loop, stmt))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	OPTINFO_VECT_REMARK << optinfo_printf (
 	                 "grouped access in outer loop.\n");
       return false;
     }
@@ -2997,7 +2997,7 @@ vect_analyze_data_ref_accesses (vec_info *vinfo)
 
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	      OPTINFO_VECT_REMARK << optinfo_printf (
 			       "Detected interleaving ");
 	      if (DR_IS_READ (dra))
 		dump_printf (MSG_NOTE, "load ");
@@ -3026,7 +3026,7 @@ vect_analyze_data_ref_accesses (vec_info *vinfo)
         && !vect_analyze_data_ref_access (dr))
       {
 	if (optinfo_enabled_p ())
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	  OPTINFO_VECT_FAILURE << (
 	                   "not vectorized: complicated access pattern.\n");
 
         if (is_a <bb_vec_info> (vinfo))
@@ -3180,7 +3180,7 @@ dependence_distance_ge_vf (data_dependence_relation *ddr,
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+      OPTINFO_VECT_REMARK << optinfo_printf (
 		       "dependence distance between ");
       dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (DDR_A (ddr)));
       dump_printf (MSG_NOTE,  " and ");
@@ -3222,7 +3222,7 @@ vect_check_lower_bound (loop_vec_info loop_vinfo, tree expr, bool unsigned_p,
 	    lower_bounds[i].min_value = min_value;
 	    if (optinfo_enabled_p ())
 	      {
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+		OPTINFO_VECT_REMARK << optinfo_printf (
 				 "updating run-time check to ");
 		dump_lower_bound (MSG_NOTE, lower_bounds[i]);
 		dump_printf (MSG_NOTE, "\n");
@@ -3234,7 +3234,7 @@ vect_check_lower_bound (loop_vec_info loop_vinfo, tree expr, bool unsigned_p,
   vec_lower_bound lower_bound (expr, unsigned_p, min_value);
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "need a run-time check that ");
+      OPTINFO_VECT_REMARK << optinfo_printf ( "need a run-time check that ");
       dump_lower_bound (MSG_NOTE, lower_bound);
       dump_printf (MSG_NOTE, "\n");
     }
@@ -3366,7 +3366,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "checking that ");
+		  OPTINFO_VECT_REMARK << optinfo_printf ( "checking that ");
 		  dump_generic_expr (MSG_NOTE, TDF_SLIM, new_pair.first);
 		  dump_printf (MSG_NOTE, " and ");
 		  dump_generic_expr (MSG_NOTE, TDF_SLIM, new_pair.second);
@@ -3391,7 +3391,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	      OPTINFO_VECT_REMARK << optinfo_printf (
 			       "no need for alias check between ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_a));
 	      dump_printf (MSG_NOTE, " and ");
@@ -3414,7 +3414,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 	  bool unsigned_p = dr_known_forward_stride_p (dr_a);
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "no alias between ");
+	      OPTINFO_VECT_REMARK << optinfo_printf ( "no alias between ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_a));
 	      dump_printf (MSG_NOTE, " and ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_b));
@@ -3490,7 +3490,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 					     access_size_b);
 	  if (res >= 0 && optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	      OPTINFO_VECT_REMARK << optinfo_printf (
 			       "can tell at compile time that ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_a));
 	      dump_printf (MSG_NOTE, " and ");
@@ -3507,7 +3507,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 	  if (res == 1)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+		OPTINFO_VECT_REMARK << optinfo_printf (
 				 "not vectorized: compilation time alias.\n");
 	      return false;
 	    }
@@ -3529,7 +3529,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
   unsigned int count = (comp_alias_ddrs.length ()
 			+ check_unequal_addrs.length ());
 
-  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+  OPTINFO_VECT_REMARK << optinfo_printf (
 		   "improved number of alias checks from %d to %d\n",
 		   may_alias_ddrs.length (), count);
   if ((int) count > PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS))
@@ -3537,7 +3537,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
       if (optinfo_enabled_p ())
 	// FIXME: would be nice to have special highlighting for
 	// command-line options (e.g. params)
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << optinfo_printf ("number of versioning for alias "
 			     "run-time tests exceeds %d "
 			     "(--param vect-max-version-for-alias-checks)",
@@ -3938,7 +3938,7 @@ again:
       if (!dr || !DR_REF (dr))
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 	                     "not vectorized: unhandled data-ref\n");
           return false;
         }
@@ -4059,7 +4059,7 @@ again:
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("not vectorized: data ref analysis "
 			"failed ")
 		    << stmt;
@@ -4075,7 +4075,7 @@ again:
       if (TREE_CODE (DR_BASE_ADDRESS (dr)) == INTEGER_CST)
         {
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+            OPTINFO_VECT_FAILURE << (
                              "not vectorized: base addr of dr is a "
                              "constant\n");
 
@@ -4091,7 +4091,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< "not vectorized: volatile type "
 		<< stmt;
             }
@@ -4106,7 +4106,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< "not vectorized: statement can throw an exception "
 		<< stmt;
             }
@@ -4124,7 +4124,7 @@ again:
 	{
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< ("not vectorized: statement is bitfield "
 		    "access ")
 		<< stmt;
@@ -4149,7 +4149,7 @@ again:
 	{
 	  if (optinfo_enabled_p ())
 	    {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< "not vectorized: dr in a call "
 		<< stmt;
 	    }
@@ -4183,7 +4183,7 @@ again:
 
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "analyze in outer loop: "
 		<< slim (init_ref);
 	    }
@@ -4195,7 +4195,7 @@ again:
 
           if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	      OPTINFO_VECT_REMARK << optinfo_printf (
                                "\touter base_address: ");
 	      dump_generic_expr (MSG_NOTE, TDF_SLIM,
                                  STMT_VINFO_DR_BASE_ADDRESS (stmt_info));
@@ -4224,7 +4224,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< ("not vectorized: more than one data ref "
 		    "in stmt: ")
 		<< stmt;
@@ -4252,7 +4252,7 @@ again:
 	{
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< ("not vectorized: base object not addressable "
 		    "for stmt: ")
 		<< stmt;
@@ -4275,7 +4275,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< "not vectorized: no vectype for stmt: "
 		<< stmt
 		<< " scalar_type: "
@@ -4302,7 +4302,7 @@ again:
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "got vectype for stmt: "
 		<< stmt
 		<< slim (STMT_VINFO_VECTYPE (stmt_info));
@@ -4325,7 +4325,7 @@ again:
 	      free_data_ref (dr);
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ((gatherscatter == GATHER) ?
 			"not vectorized: not suitable for gather "
 			"load " :
@@ -4348,7 +4348,7 @@ again:
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("not vectorized: not suitable for strided "
 			"load ")
 		    << stmt;
@@ -4580,7 +4580,7 @@ vect_create_addr_base_for_vector_ref (gimple *stmt,
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "created ");
+      OPTINFO_VECT_REMARK << optinfo_printf ( "created ");
       dump_generic_expr (MSG_NOTE, TDF_SLIM, addr_base);
       dump_printf (MSG_NOTE, "\n");
     }
@@ -4708,7 +4708,7 @@ vect_create_data_ref_ptr (gimple *stmt, tree aggr_type, struct loop *at_loop,
   if (optinfo_enabled_p ())
     {
       tree dr_base_type = TREE_TYPE (DR_BASE_OBJECT (dr));
-      pending_optinfo po = EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      pending_optinfo po = OPTINFO_VECT_REMARK
 	<< optinfo_printf ("create %s-pointer variable to type: ",
 			   get_tree_code_name (TREE_CODE (aggr_type)))
 	<< slim (aggr_type);
@@ -5035,7 +5035,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
   if (count != 3 && exact_log2 (count) == -1)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("the size of the group of accesses"
 	      " is not a power of 2 or not equal to 3");
       return false;
@@ -5054,7 +5054,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
 	  if (!GET_MODE_NUNITS (mode).is_constant (&nelt))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("cannot handle groups of 3 stores for"
 		      " variable-length vectors");
 	      return false;
@@ -5081,7 +5081,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		    OPTINFO_VECT_FAILURE
 		      << "permutation op not supported by target";
 		  return false;
 		}
@@ -5099,7 +5099,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		    OPTINFO_VECT_FAILURE
 		      << "permutation op not supported by target";
 		  return false;
 		}
@@ -5133,7 +5133,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+    OPTINFO_VECT_FAILURE
       << "permutation op not supported by target";
   return false;
 }
@@ -5646,7 +5646,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
   if (single_element_p && maybe_gt (count, TYPE_VECTOR_SUBPARTS (vectype)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	OPTINFO_VECT_FAILURE << (
 			 "single-element interleaving not supported "
 			 "for not adjacent vector loads\n");
       return false;
@@ -5657,7 +5657,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
   if (count != 3 && exact_log2 (count) == -1)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	OPTINFO_VECT_FAILURE << (
 			 "the size of the group of accesses"
 			 " is not a power of 2 or not equal to 3\n");
       return false;
@@ -5673,7 +5673,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	  if (!GET_MODE_NUNITS (mode).is_constant (&nelt))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+		OPTINFO_VECT_FAILURE << (
 				 "cannot handle groups of 3 loads for"
 				 " variable-length vectors\n");
 	      return false;
@@ -5694,7 +5694,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+		    OPTINFO_VECT_FAILURE << (
 				     "shuffle of 3 loads is not supported by"
 				     " target\n");
 		  return false;
@@ -5708,7 +5708,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+		    OPTINFO_VECT_FAILURE << (
 				     "shuffle of 3 loads is not supported by"
 				     " target\n");
 		  return false;
@@ -5740,7 +5740,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+    OPTINFO_VECT_FAILURE << (
 		     "extract even/odd not supported by target\n");
   return false;
 }
@@ -6083,7 +6083,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "shuffle of 2 fields structure is not \
 			      supported by target\n");
 	  return false;
@@ -6098,7 +6098,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "shuffle of 2 fields structure is not \
 			      supported by target\n");
 	  return false;
@@ -6113,7 +6113,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
@@ -6129,7 +6129,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
+	    OPTINFO_VECT_FAILURE << (
 			     "select is not supported by target\n");
 	  return false;
 	}
@@ -6193,9 +6193,8 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "shuffle of 3 fields structure is not \
-			      supported by target\n");
+	    OPTINFO_VECT_FAILURE
+	      << "shuffle of 3 fields structure is not supported by target";
 	  return false;
 	}
       perm3_mask = vect_gen_perm_mask_checked (vectype, indices);
@@ -6208,8 +6207,8 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "shift permutation is not supported by target\n");
+	    OPTINFO_VECT_FAILURE
+	      << "shift permutation is not supported by target";
 	  return false;
 	}
       shift1_mask = vect_gen_perm_mask_checked (vectype, indices);
@@ -6222,8 +6221,8 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "shift permutation is not supported by target\n");
+	    OPTINFO_VECT_FAILURE
+	      << "shift permutation is not supported by target";
 	  return false;
 	}
       shift2_mask = vect_gen_perm_mask_checked (vectype, indices);
@@ -6236,8 +6235,8 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "shift permutation is not supported by target\n");
+	    OPTINFO_VECT_FAILURE
+	      << "shift permutation is not supported by target";
 	  return false;
 	}
       shift3_mask = vect_gen_perm_mask_checked (vectype, indices);
@@ -6250,8 +6249,8 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << (
-			     "shift permutation is not supported by target\n");
+	    OPTINFO_VECT_FAILURE
+	      << "shift permutation is not supported by target";
 	  return false;
 	}
       shift4_mask = vect_gen_perm_mask_checked (vectype, indices);
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 71c66de..9fcc7d6 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -228,7 +228,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	  phi = si.phi ();
 	  stmt_info = vinfo_for_stmt (phi);
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "==> examining phi: "
 	      << phi;
 
@@ -242,7 +242,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "get vectype for scalar type:  "
 		    << slim (scalar_type);
 		}
@@ -252,7 +252,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< "not vectorized: unsupported data-type "
 			<< slim (scalar_type);
 		    }
@@ -261,14 +261,14 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	      STMT_VINFO_VECTYPE (stmt_info) = vectype;
 
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		OPTINFO_VECT_REMARK
 		  << "vectype: "
 		  << slim (vectype);
 
 	      if (optinfo_enabled_p ())
 		{
 #if 0
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "nunits = "
 		    << TYPE_VECTOR_SUBPARTS (vectype);
 #endif
@@ -292,7 +292,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "==> examining statement: "
 		<< stmt;
 	    }
@@ -313,7 +313,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
                   stmt_info = vinfo_for_stmt (pattern_stmt);
                   if (optinfo_enabled_p ())
                     {
-                      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+                      OPTINFO_VECT_REMARK
 			<< "==> examining pattern statement: "
 			<< stmt;
                     }
@@ -321,7 +321,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
               else
 	        {
 	          if (optinfo_enabled_p ())
-	            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	            OPTINFO_VECT_REMARK
 		      << "skip";
                   gsi_next (&si);
 	          continue;
@@ -363,7 +363,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		    {
 		      if (optinfo_enabled_p ())
 			{
-			  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+			  OPTINFO_VECT_REMARK
 			    << "==> examining pattern def stmt: "
 			    << pattern_def_stmt;
 			}
@@ -402,7 +402,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		}
 	      if (optinfo_enabled_p ())
 		{
-	          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	          OPTINFO_VECT_FAILURE
 		    << "not vectorized: irregular stmt: " << stmt;
 		}
 	      return false;
@@ -412,7 +412,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	    {
 	      if (optinfo_enabled_p ())
 	        {
-	          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	          OPTINFO_VECT_FAILURE
 		    << "not vectorized: vector stmt in loop: " << stmt;
 	        }
 	      return false;
@@ -469,7 +469,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "get vectype for scalar type:  "
 		    << slim (scalar_type);
 		}
@@ -478,7 +478,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< "not vectorized: unsupported data-type: "
 			<< slim (scalar_type);
 		    }
@@ -490,7 +490,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "vectype: "
 		    << slim (vectype);
 		}
@@ -510,7 +510,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 							     &dummy);
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "get vectype for scalar type:  "
 		    << slim (scalar_type);
 		}
@@ -520,7 +520,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "not vectorized: unsupported data-type "
 		    << slim (scalar_type);
 		}
@@ -532,7 +532,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("not vectorized: different sized vector "
 			"types in statement, ")
 		    << slim (vectype)
@@ -544,14 +544,14 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "vectype: " << slim (vf_vectype);
 	    }
 
 	  if (optinfo_enabled_p ())
 	    {
 #if 0
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "nunits = "
 	      dump_dec (MSG_NOTE, TYPE_VECTOR_SUBPARTS (vf_vectype));
 	      dump_printf (MSG_NOTE, "\n");
@@ -572,7 +572,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
   if (optinfo_enabled_p ())
     {
 #if 0
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "vectorization factor = "
       dump_dec (MSG_NOTE, vectorization_factor);
 #endif
@@ -581,7 +581,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
   if (known_le (vectorization_factor, 1U))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+        OPTINFO_VECT_FAILURE
 	  << "not vectorized: unsupported data-type";
       return false;
     }
@@ -604,7 +604,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	  if (!mask_type)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "not vectorized: unsupported mask";
 	      return false;
 	    }
@@ -623,7 +623,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< ("not vectorized: can't compute mask type "
 			    "for statement, ")
 			<< stmt;
@@ -644,7 +644,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< ("not vectorized: different sized masks "
 			    "types in statement, ")
 			<< slim (mask_type)
@@ -658,7 +658,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< ("not vectorized: mixed mask and "
 			    "nonmask vector types in statement, ")
 			<< slim (mask_type)
@@ -685,7 +685,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      OPTINFO_VECT_FAILURE
 		<< ("not vectorized: can't compute mask type "
 		    "for statement, ")
 		<< stmt;
@@ -729,7 +729,7 @@ vect_is_simple_iv_evolution (unsigned loop_nb, tree access_fn, tree * init,
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "step: " << slim (step_expr)
 	<< ",  init: " << slim (init_expr);
     }
@@ -748,7 +748,7 @@ vect_is_simple_iv_evolution (unsigned loop_nb, tree access_fn, tree * init,
 	  || !flag_associative_math))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+        OPTINFO_VECT_FAILURE
 	  << "step unknown";
       return false;
     }
@@ -786,7 +786,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "Analyze phi: " << phi;
 	}
 
@@ -804,7 +804,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
 	  STRIP_NOPS (access_fn);
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "Access function of PHI: " << slim (access_fn);
 	    }
 	  STMT_VINFO_LOOP_PHI_EVOLUTION_BASE_UNCHANGED (stmt_vinfo)
@@ -827,7 +827,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
       gcc_assert (STMT_VINFO_LOOP_PHI_EVOLUTION_PART (stmt_vinfo) != NULL_TREE);
 
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "Detected induction";
       STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_induction_def;
     }
@@ -843,7 +843,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
 
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+          OPTINFO_VECT_REMARK
 	    << "Analyze phi: " << phi;
         }
 
@@ -857,7 +857,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
           if (double_reduc)
             {
               if (optinfo_enabled_p ())
-                EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+                OPTINFO_VECT_REMARK
 		  << "Detected double reduction";
 
               STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_double_reduction_def;
@@ -869,7 +869,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
               if (loop != LOOP_VINFO_LOOP (loop_vinfo))
                 {
                   if (optinfo_enabled_p ())
-                    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+                    OPTINFO_VECT_REMARK
 		      << "Detected vectorizable nested cycle";
 
                   STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_nested_cycle;
@@ -879,7 +879,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
               else
                 {
                   if (optinfo_enabled_p ())
-                    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+                    OPTINFO_VECT_REMARK
 		      << "Detected reduction";
 
                   STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_reduction_def;
@@ -895,7 +895,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
         }
       else
         if (optinfo_enabled_p ())
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+          OPTINFO_VECT_FAILURE
 	    << "Unknown def-use cycle pattern";
     }
 }
@@ -1479,7 +1479,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if (loop->num_nodes != 2)
         {
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+            OPTINFO_VECT_FAILURE
 	      << "not vectorized: control flow in loop";
           return false;
         }
@@ -1487,7 +1487,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if (empty_block_p (loop->header))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: empty loop";
 	  return false;
 	}
@@ -1517,7 +1517,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if ((loop->inner)->inner || (loop->inner)->next)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: multiple nested loops";
 	  return false;
 	}
@@ -1525,7 +1525,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if (loop->num_nodes != 5)
         {
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: control flow in loop";
 	  return false;
         }
@@ -1536,7 +1536,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
 	  || single_exit (innerloop)->dest != EDGE_PRED (loop->latch, 0)->src)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: unsupported outerloop form";
 	  return false;
 	}
@@ -1551,7 +1551,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
 	  || !integer_onep (inner_assumptions))
 	{
 	  if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+            OPTINFO_VECT_FAILURE
 	      << "not vectorized: bad inner loop";
 	  return false;
 	}
@@ -1559,13 +1559,13 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if (!expr_invariant_in_loop_p (loop, inner_niter))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: inner-loop count not invariant";
 	  return false;
 	}
 
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+        OPTINFO_VECT_REMARK
 	  << "Considering outer-loop vectorization";
     }
 
@@ -1575,10 +1575,10 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       if (optinfo_enabled_p ())
         {
           if (!single_exit (loop))
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: multiple exits";
           else if (EDGE_COUNT (loop->header->preds) != 2)
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: too many incoming edges";
         }
       return false;
@@ -1592,7 +1592,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       || !gimple_seq_empty_p (phi_nodes (loop->latch)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: latch block not empty";
       return false;
     }
@@ -1602,7 +1602,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
   if (e->flags & EDGE_ABNORMAL)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: abnormal loop exit edge";
       return false;
     }
@@ -1612,7 +1612,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
   if (!*loop_cond)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: complicated exit condition";
       return false;
     }
@@ -1622,7 +1622,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
       || chrec_contains_undetermined (*number_of_iterations))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: number of iterations cannot be computed";
       return false;
     }
@@ -1630,7 +1630,7 @@ vect_analyze_loop_form_1 (struct loop *loop, gcond **loop_cond,
   if (integer_zerop (*number_of_iterations))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: number of iterations = 0";
       return false;
     }
@@ -1671,7 +1671,7 @@ vect_analyze_loop_form (struct loop *loop)
 
   if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
     if (optinfo_enabled_p ())
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "symbolic number of iterations is "
 	<< details (number_of_iterations);
 
@@ -1734,13 +1734,13 @@ vect_update_vf_for_slp (loop_vec_info loop_vinfo)
 
   if (only_slp_in_loop)
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "Loop contains only SLP stmts";
       vectorization_factor = LOOP_VINFO_SLP_UNROLLING_FACTOR (loop_vinfo);
     }
   else
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "Loop contains SLP and non-SLP stmts";
       /* Both the vectorization factor and unroll factor have the form
 	 current_vector_size * X for some rational X, so they must have
@@ -1754,7 +1754,7 @@ vect_update_vf_for_slp (loop_vec_info loop_vinfo)
   if (optinfo_enabled_p ())
     {
 #if 0
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "Updating vectorization factor to ");
       dump_dec (MSG_NOTE, vectorization_factor);
 #endif
@@ -1819,7 +1819,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
           stmt_info = vinfo_for_stmt (phi);
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+              OPTINFO_VECT_REMARK
 		<< "examining phi: "
 		<< phi;
             }
@@ -1838,7 +1838,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
 		  && !vect_active_double_reduction_p (stmt_info))
                 {
                   if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		    OPTINFO_VECT_FAILURE
 		      << "Unsupported loop-closed phi in outer-loop";
                   return false;
                 }
@@ -1881,7 +1881,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
             {
               /* A scalar-dependence cycle that we don't support.  */
               if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "not vectorized: scalar dependence cycle";
               return false;
             }
@@ -1908,7 +1908,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
             {
               if (optinfo_enabled_p ())
                 {
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "not vectorized: relevant phi not supported: "
 		    << phi;
                 }
@@ -1934,10 +1934,10 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
   if (!need_to_vectorize)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+        OPTINFO_VECT_REMARK
 	  << "All the computation can be taken out of the loop";
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: redundant loop. no profit to vectorize";
       return false;
     }
@@ -1970,7 +1970,7 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo)
 	  && (unsigned HOST_WIDE_INT) max_niter < assumed_vf)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("not vectorized: iteration count smaller than "
 		  "vectorization factor");
 	  return 0;
@@ -1984,10 +1984,10 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo)
   if (min_profitable_iters < 0)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: vectorization not profitable";
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: vector version will never be profitable";
       return -1;
     }
@@ -2006,10 +2006,10 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo)
       && LOOP_VINFO_INT_NITERS (loop_vinfo) < th)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: vectorization not profitable";
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << ("not vectorized: iteration count smaller than user "
 	      "specified loop bound parameter or minimum profitable "
 	      "iterations (whichever is more conservative)");
@@ -2024,10 +2024,10 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo)
 	  < MAX (th, (unsigned) min_profitable_estimate)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "not vectorized: estimated iteration count too small";
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << ("not vectorized: estimated iteration count smaller "
 	      "than specified loop bound parameter or minimum "
 	      "profitable iterations (whichever is more "
@@ -2065,7 +2065,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
   if (!find_loop_nest (loop, &LOOP_VINFO_LOOP_NEST (loop_vinfo)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("not vectorized: loop nest containing two "
 	      "or more consecutive inner loops cannot be "
 	      "vectorized");
@@ -2114,7 +2114,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
 		  }
 	      }
 	    if (optinfo_enabled_p ())
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      OPTINFO_VECT_FAILURE
 		<< ("not vectorized: loop contains function "
 		    "calls or data references that cannot "
 		    "be analyzed");
@@ -2129,7 +2129,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "bad data references";
       return false;
     }
@@ -2149,7 +2149,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "bad data access";
       return false;
     }
@@ -2160,7 +2160,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "unexpected pattern";
       return false;
     }
@@ -2179,7 +2179,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
 	  && maybe_lt (max_vf, min_vf)))
     {
       if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "bad data dependence";
       return false;
     }
@@ -2189,7 +2189,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "can't determine vectorization factor";
       return false;
     }
@@ -2197,7 +2197,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
       && maybe_lt (max_vf, LOOP_VINFO_VECT_FACTOR (loop_vinfo)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "bad data dependence";
       return false;
     }
@@ -2240,7 +2240,7 @@ start_over:
   if (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) && optinfo_enabled_p ())
     {
 #if 0
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "vectorization_factor = "
       dump_dec (MSG_NOTE, vectorization_factor);
       dump_printf (MSG_NOTE, ", niters = " HOST_WIDE_INT_PRINT_DEC "\n",
@@ -2258,7 +2258,7 @@ start_over:
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "bad data alignment";
       return false;
     }
@@ -2280,7 +2280,7 @@ start_over:
     if (!ok)
       {
 	if (optinfo_enabled_p ())
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << "bad data alignment";
         return false;
       }
@@ -2303,7 +2303,7 @@ start_over:
   if (!ok)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "bad operation or unsupported loop bound";
       return false;
     }
@@ -2316,10 +2316,10 @@ start_over:
   if (optinfo_enabled_p ())
     {
       if (LOOP_VINFO_FULLY_MASKED_P (loop_vinfo))
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "using a fully-masked loop";
       else
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "not using a fully-masked loop";
     }
 
@@ -2336,7 +2336,7 @@ start_over:
       if (known_lt (wi::to_widest (scalar_niters), vf))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << ("loop has not enough iterations to support"
 		  " peeling for gaps");
 	  return false;
@@ -2350,7 +2350,7 @@ start_over:
   if (!res)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "Loop costings not worthwhile";
       return false;
     }
@@ -2388,7 +2388,7 @@ start_over:
       || LOOP_VINFO_PEELING_FOR_NITER (loop_vinfo))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+        OPTINFO_VECT_REMARK
 	  << "epilog loop required";
       if (!vect_can_advance_ivs_p (loop_vinfo)
 	  || !slpeel_can_duplicate_loop_p (LOOP_VINFO_LOOP (loop_vinfo),
@@ -2396,7 +2396,7 @@ start_over:
 							 (loop_vinfo))))
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not vectorized: can't create required epilog loop";
           goto again;
         }
@@ -2483,7 +2483,7 @@ again:
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << "re-trying with SLP disabled";
 
   /* Roll back state appropriately.  No SLP this time.  */
@@ -2567,7 +2567,7 @@ vect_analyze_loop (struct loop *loop, loop_vec_info orig_loop_vinfo)
       && LOOP_VINFO_VECTORIZABLE_P (loop_vec_info_for_loop (loop_outer (loop))))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "outer-loop already vectorized";
       return NULL;
     }
@@ -2580,7 +2580,7 @@ vect_analyze_loop (struct loop *loop, loop_vec_info orig_loop_vinfo)
       if (!loop_vinfo)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "bad loop form";
 	  return NULL;
 	}
@@ -2616,7 +2616,7 @@ vect_analyze_loop (struct loop *loop, loop_vec_info orig_loop_vinfo)
       if (optinfo_enabled_p ())
 	{
 #if 0
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "***** Re-trying analysis with vector size ";
 	  dump_dec (MSG_NOTE, current_vector_size);
 	  dump_printf (MSG_NOTE, "\n");
@@ -2919,7 +2919,7 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple *phi,
   	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		  OPTINFO_VECT_REMARK
 		    << "swapping oprnds: " << next_stmt;
 		}
 
@@ -3174,7 +3174,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
       if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)))
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "intermediate value used outside loop";
 
           return NULL;
@@ -3184,7 +3184,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
       if (nloop_uses > 1)
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "reduction value used in loop";
           return NULL;
         }
@@ -3197,7 +3197,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
   if (TREE_CODE (loop_arg) != SSA_NAME)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "reduction: not ssa_name: "
 	  << slim (loop_arg);
       return NULL;
@@ -3218,7 +3218,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << "reduction: unhandled reduction operation: "
 	    << def_stmt;
 	}
@@ -3243,7 +3243,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
       if (nloop_uses > 1)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "reduction used in loop";
 	  return NULL;
 	}
@@ -3259,7 +3259,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
           || TREE_CODE (op1) != SSA_NAME)
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "unsupported phi node definition";
 
           return NULL;
@@ -3379,7 +3379,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
       if (optinfo_enabled_p ())
         {
 	  pending_optinfo info
-	    = EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    = OPTINFO_VECT_REMARK
 	        << "reduction: multiple types: operation type: "
 		<< slim (type)
 		<< ", operands types: "
@@ -3594,7 +3594,7 @@ vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
     {
       *peel_iters_epilogue = assumed_vf / 2;
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+        OPTINFO_VECT_REMARK
 	  << ("cost model: epilogue peel iters set to vf/2 "
 	      "because loop iterations are unknown");
 
@@ -3679,7 +3679,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
   /* Cost model disabled.  */
   if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "cost model disabled";
       *ret_min_profitable_niters = 0;
       *ret_min_profitable_estimate = 0;
@@ -3944,7 +3944,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
     {
       /* FIXME: do we want to do something special for such a table of
 	 data?  */
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "Cost model analysis:\n"
 	<< optinfo_printf ("  Vector inside of loop cost: %d\n",
 			   vec_inside_cost)
@@ -4002,7 +4002,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
 		    "did not happen for a simd loop");
 
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+        OPTINFO_VECT_FAILURE
 	  << optinfo_printf ("cost model: the vector iteration cost = %d "
 			     "divided by the scalar iteration cost = %d "
 			     "is greater or equal to the vectorization factor = %d",
@@ -4022,7 +4022,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
     min_profitable_iters = assumed_vf + peel_iters_prologue;
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << optinfo_printf ("  Runtime profitability threshold = %d",
 			 min_profitable_iters);
 
@@ -4048,7 +4048,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
     }
   min_profitable_estimate = MAX (min_profitable_estimate, min_profitable_iters);
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << optinfo_printf ("  Static estimate profitability threshold = %d",
 			 min_profitable_estimate);
 
@@ -4300,7 +4300,7 @@ vect_model_induction_cost (stmt_vec_info stmt_info, int ncopies)
 				 stmt_info, 0, vect_prologue);
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << optinfo_printf ("vect_model_induction_cost: inside_cost = %d, "
 			 "prologue_cost = %d",
 			 inside_cost, prologue_cost);
@@ -4895,7 +4895,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
 
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+              OPTINFO_VECT_REMARK
 		<< "transform reduction: created def-use cycle: "
 		<< phi << SSA_NAME_DEF_STMT (def);
             }
@@ -5382,7 +5382,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
          v_out2 = reduc_expr <v_out1>  */
 
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+        OPTINFO_VECT_REMARK
 	  << "Reduce using direct vector reduction";
 
       vec_elem_type = TREE_TYPE (TREE_TYPE (new_phi_result));
@@ -5653,7 +5653,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
           tree rhs;
 
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+            OPTINFO_VECT_REMARK
 	      << "Reduce using vector shifts";
 
 	  mode1 = TYPE_MODE (vectype1);
@@ -5682,7 +5682,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
 	     s_out3 = extract_field <v_out2, bitpos>  */
 
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "extract scalar result";
 
 	  rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp,
@@ -5706,7 +5706,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
                }  */
 
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+            OPTINFO_VECT_REMARK
 	      << "Reduce using scalar code";
 
 	  int vec_size_in_bits = tree_to_uhwi (TYPE_SIZE (vectype1));
@@ -6030,7 +6030,7 @@ vect_finalize_reduction:
                                loop_latch_edge (outer_loop), UNKNOWN_LOCATION);
                   if (optinfo_enabled_p ())
                     {
-                      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+                      OPTINFO_VECT_REMARK
 			<< "created double reduction phi node: "
 			<< vect_phi;
                     }
@@ -6712,7 +6712,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (STMT_VINFO_REDUC_TYPE (stmt_info) == FOLD_LEFT_REDUCTION)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "in-order reduction chain without SLP";
 	  return false;
 	}
@@ -6766,7 +6766,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (reduc_index == -1)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "conditional reduction chains not supported";
 	  return false;
 	}
@@ -6791,7 +6791,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 					       vectype_in, OPTIMIZE_FOR_SPEED))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "optimizing condition reduction with FOLD_EXTRACT_LAST";
 	  STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) = EXTRACT_LAST_REDUCTION;
 	}
@@ -6831,7 +6831,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  if (cond_reduc_val)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		OPTINFO_VECT_REMARK
 		  << "condition expression based on integer induction";
 	      STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info)
 		= INTEGER_INDUC_COND_REDUCTION;
@@ -6856,7 +6856,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	      if (e && (integer_onep (e) || integer_zerop (e)))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		    OPTINFO_VECT_REMARK
 		      << ("condition expression based on "
 			  "compile time constant");
 		  /* Record reduction code at analysis stage.  */
@@ -6899,7 +6899,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 						ops[reduc_index], 0, NULL))
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "unsupported condition in reduction";
 	  return false;
         }
@@ -6914,7 +6914,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  /* Shifts and rotates are only supported by vectorizable_shifts,
 	     not vectorizable_reduction.  */
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "unsupported shift or rotation";
 	  return false;
 	}
@@ -6924,7 +6924,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!optab)
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "no optab";
 
           return false;
@@ -6948,7 +6948,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  && !vect_worthwhile_without_simd_p (loop_vinfo, code))
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "not worthwhile without SIMD support";
 
           return false;
@@ -7054,7 +7054,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 						  OPTIMIZE_FOR_SPEED))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "reduc op not supported by target";
 
 	      reduc_fn = IFN_LAST;
@@ -7065,7 +7065,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  if (!nested_cycle || double_reduc)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << "no reduc code for scalar code";
 
 	      return false;
@@ -7090,7 +7090,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       && !nunits_out.is_constant ())
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("missing target support for reduction on"
 	      " variable-length vectors");
       return false;
@@ -7100,7 +7100,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       && ncopies > 1)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("multiple types in double reduction or condition "
 	      "reduction");
       return false;
@@ -7130,7 +7130,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 
 	 which is a reassociation of the original operation.  */
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "in-order double reduction not supported";
 
       return false;
@@ -7143,7 +7143,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       /* We cannot use in-order reductions in this case because there is
 	 an implicit reassociation of the operations involved.  */
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << "in-order unchained SLP reductions not supported";
       return false;
     }
@@ -7158,7 +7158,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 					  vectype_out, OPTIMIZE_FOR_SPEED))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("reduction on variable-length vectors requires"
 	      " target support for a vector-shift-and-insert"
 	      " operation");
@@ -7181,7 +7181,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  && !can_duplicate_and_interleave_p (group_size, elt_mode))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("unsupported form of SLP reduction for"
 		  " variable-length vectors: cannot build"
 		  " initial vector");
@@ -7193,7 +7193,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!multiple_p (nunits_out, group_size))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("unsupported form of SLP reduction for"
 		  " variable-length vectors: the vector size"
 		  " is not a multiple of the number of results");
@@ -7214,7 +7214,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       else
         {
           if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "invalid types in dot-prod";
 
           return false;
@@ -7228,7 +7228,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (! max_loop_iterations (loop, &ni))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "loop count not known, cannot create cond reduction";
 	  return false;
 	}
@@ -7242,7 +7242,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
       if (wi::geu_p (ni, wi::to_widest (max_index)))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "loop size is greater than data size";
 	  return false;
 	}
@@ -7300,7 +7300,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  || code == SAD_EXPR))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("multi def-use cycle not possible for lane-reducing "
 	      "reduction operation");
       return false;
@@ -7326,7 +7326,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 						      OPTIMIZE_FOR_SPEED)))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("can't use a fully-masked loop because no"
 		      " conditional operation is available");
 	      LOOP_VINFO_CAN_FULLY_MASK_P (loop_vinfo) = false;
@@ -7334,7 +7334,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	  else if (reduc_index == -1)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("can't use a fully-masked loop for chained"
 		      " reductions");
 	      LOOP_VINFO_CAN_FULLY_MASK_P (loop_vinfo) = false;
@@ -7345,7 +7345,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
 	}
       if (optinfo_enabled_p ()
 	  && reduction_type == FOLD_LEFT_REDUCTION)
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "using an in-order (fold-left) reduction";
       STMT_VINFO_TYPE (stmt_info) = reduc_vec_info_type;
       return true;
@@ -7354,7 +7354,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
   /* Transform.  */
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << "transform reduction";
 
   /* FORNOW: Multiple types are not supported for condition.  */
@@ -7650,7 +7650,7 @@ vectorizable_induction (gimple *phi,
       if (ncopies > 1)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << "multiple types in nested loop";
 	  return false;
 	}
@@ -7681,7 +7681,7 @@ vectorizable_induction (gimple *phi,
 		&& !STMT_VINFO_LIVE_P (exit_phi_vinfo)))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("inner-loop induction only used outside "
 		      "of the outer vectorized loop");
 	      return false;
@@ -7699,7 +7699,7 @@ vectorizable_induction (gimple *phi,
     {
       /* The current SLP code creates the initial value element-by-element.  */
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	OPTINFO_VECT_FAILURE
 	  << ("SLP induction not supported for variable-length"
 	      " vectors.\n");
       return false;
@@ -7721,7 +7721,7 @@ vectorizable_induction (gimple *phi,
      [X, X + S, X + 2*S, X + 3*S].  */
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+    OPTINFO_VECT_REMARK
       << "transform induction phi";
 
   latch_e = loop_latch_edge (iv_loop);
@@ -8115,7 +8115,7 @@ vectorizable_induction (gimple *phi,
 	  STMT_VINFO_VEC_STMT (stmt_vinfo) = new_stmt;
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "vector of inductions after inner-loop:" << new_stmt;
 	    }
 	}
@@ -8124,7 +8124,7 @@ vectorizable_induction (gimple *phi,
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+      OPTINFO_VECT_REMARK
 	<< "transform induction: created def-use cycle: "
 	<< induction_phi << SSA_NAME_DEF_STMT (vec_def);
     }
@@ -8172,7 +8172,7 @@ vectorizable_live_operation (gimple *stmt,
     {
       gcc_assert (is_simple_and_all_uses_invariant (stmt, loop_vinfo));
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << "statement is simple and uses invariant.  Leaving in place";
       return true;
     }
@@ -8199,7 +8199,7 @@ vectorizable_live_operation (gimple *stmt,
       if (!can_div_trunc_p (pos, nunits, &vec_entry, &vec_index))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("Cannot determine which vector holds the"
 		  " final result");
 	  return false;
@@ -8215,7 +8215,7 @@ vectorizable_live_operation (gimple *stmt,
 					       OPTIMIZE_FOR_SPEED))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("can't use a fully-masked loop because "
 		      "the target doesn't support extract last "
 		      "reduction");
@@ -8224,7 +8224,7 @@ vectorizable_live_operation (gimple *stmt,
 	  else if (slp_node)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("can't use a fully-masked loop because an "
 		      "SLP statement is live after the loop");
 	      LOOP_VINFO_CAN_FULLY_MASK_P (loop_vinfo) = false;
@@ -8232,7 +8232,7 @@ vectorizable_live_operation (gimple *stmt,
 	  else if (ncopies > 1)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		OPTINFO_VECT_FAILURE
 		  << ("can't use a fully-masked loop because"
 		      " ncopies is greater than 1.\n");
 	      LOOP_VINFO_CAN_FULLY_MASK_P (loop_vinfo) = false;
@@ -8380,7 +8380,7 @@ vect_loop_kill_debug_uses (struct loop *loop, gimple *stmt)
 	      if (gimple_debug_bind_p (ustmt))
 		{
 		  if (optinfo_enabled_p ())
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		    OPTINFO_VECT_REMARK
 		      << "killing debug use";
 
 		  gimple_debug_bind_reset_value (ustmt);
@@ -8592,7 +8592,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
       && !LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << optinfo_printf ("Profitability threshold is %d loop iterations",
 			     th);
       check_profitability = true;
@@ -8695,7 +8695,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 	  gphi *phi = si.phi ();
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "------>vectorizing phi: " << phi;
 	    }
 	  stmt_info = vinfo_for_stmt (phi);
@@ -8713,7 +8713,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 	      && (maybe_ne
 		  (TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)), vf))
 	      && optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "multiple-types";
 
 	  if ((STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def
@@ -8722,7 +8722,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 	      && ! PURE_SLP_STMT (stmt_info))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		OPTINFO_VECT_REMARK
 		  << "transform phi";
 	      vect_transform_stmt (phi, NULL, NULL, NULL, NULL);
 	    }
@@ -8751,7 +8751,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "------>vectorizing statement: " << stmt;
 	    }
 
@@ -8822,7 +8822,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 		    {
 		      if (optinfo_enabled_p ())
 			{
-			  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+			  OPTINFO_VECT_REMARK
 			    << "==> vectorizing pattern def stmt: "
 			    << pattern_def_stmt;
 			}
@@ -8849,7 +8849,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 		  && optinfo_enabled_p ())
 		  /* For SLP VF is set according to unrolling factor, and not
 		     to vector size, hence for SLP this print is not valid.  */
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		OPTINFO_VECT_REMARK
 		  << "multiple-types";
 	    }
 
@@ -8880,7 +8880,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 
 	  /* -------- vectorize statement ------------ */
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "transform statement";
 
 	  grouped_store = false;
@@ -8996,17 +8996,17 @@ vect_transform_loop (loop_vec_info loop_vinfo)
     {
       if (!LOOP_VINFO_EPILOGUE_P (loop_vinfo))
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "LOOP VECTORIZED";
 	  if (loop->inner)
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "OUTER LOOP VECTORIZED";
 	  dump_printf (MSG_NOTE, "\n");
 	}
       else
 	{
 #if 0
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "LOOP EPILOGUE VECTORIZED (VS="
 	  dump_dec (MSG_NOTE, current_vector_size);
 	    << ")";
@@ -9167,7 +9167,7 @@ optimize_mask_stores (struct loop *loop)
       if (dom_info_available_p (CDI_DOMINATORS))
 	set_immediate_dominator (CDI_DOMINATORS, store_bb, bb);
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	OPTINFO_VECT_REMARK
 	  << optinfo_printf ("Create new block %d to sink mask stores.",
 			     store_bb->index);
       /* Create vector comparison with boolean result.  */
@@ -9207,7 +9207,7 @@ optimize_mask_stores (struct loop *loop)
 	  gsi_to = gsi_start_bb (store_bb);
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	      OPTINFO_VECT_REMARK
 		<< "Move stmt to created bb " << last;
 	    }
 	  /* Move all stored value producers if possible.  */
@@ -9273,7 +9273,7 @@ optimize_mask_stores (struct loop *loop)
 
 	      /* Can move STMT1 to STORE_BB.  */
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+		OPTINFO_VECT_REMARK
 		  << "move stmt to created bb"
 		  << stmt1;
 	      gsi_move_before (&gsi_from, &gsi_to);
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index c151512..5b1d61c 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -352,7 +352,7 @@ again:
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	      OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "Build SLP failed: can't analyze def for ");
 	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
               dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -388,7 +388,7 @@ again:
 
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		  OPTINFO_VECT_FAILURE << optinfo_printf (
 					 "Build SLP failed: some of the stmts"
 					 " are in a pattern, and others are not ");
 		  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
@@ -404,7 +404,7 @@ again:
           if (dt == vect_unknown_def_type)
             {
               if (optinfo_enabled_p ())
-                EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+                OPTINFO_VECT_FAILURE << optinfo_printf (
 				       "Unsupported pattern");
               return -1;
             }
@@ -417,7 +417,7 @@ again:
 
 	    default:
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "unsupported defining stmt:\n");
 	      return -1;
             }
@@ -459,7 +459,7 @@ again:
 		}
 
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "Build SLP failed: different types\n");
 
 	      return 1;
@@ -473,7 +473,7 @@ again:
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		  OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "Build SLP failed: invalid type of def "
 				   "for variable-length SLP ");
 		  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
@@ -500,7 +500,7 @@ again:
 	  /* FORNOW: Not supported.  */
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	      OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "Build SLP failed: illegal type of def ");
 	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
               dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -519,10 +519,10 @@ again:
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
-			       "Build SLP failed: cannot swap operands of "
-			       "shared stmt ");
-	      dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
+	      OPTINFO_VECT_FAILURE 
+		<< ("Build SLP failed: cannot swap operands of "
+		    "shared stmt ")
+		<< stmt;
 	    }
 	  return -1;
 	}
@@ -555,7 +555,7 @@ again:
 			   gimple_assign_rhs2_ptr (stmt));
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "swapped operands to match def types in ");
 	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
 	}
@@ -580,7 +580,7 @@ vect_record_max_nunits (vec_info *vinfo, gimple *stmt, unsigned int group_size,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	  OPTINFO_VECT_FAILURE
 	    << "Build SLP failed: unsupported data-type in "
 	    << stmt;
 	}
@@ -596,7 +596,7 @@ vect_record_max_nunits (vec_info *vinfo, gimple *stmt, unsigned int group_size,
       && (!nunits.is_constant (&const_nunits)
 	  || const_nunits > group_size))
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+      OPTINFO_VECT_FAILURE
 	<< ("Build SLP failed: unrolling required "
 	    "in basic block SLP");
       /* Fatal mismatch.  */
@@ -652,7 +652,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "Build SLP for ");
+	  OPTINFO_VECT_REMARK << optinfo_printf ( "Build SLP for ");
 	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
 	}
 
@@ -661,7 +661,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
         {
           if (optinfo_enabled_p ())
             {
-              EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+              OPTINFO_VECT_FAILURE
 		<< "Build SLP failed: unvectorizable statement "
 		<< stmt;
             }
@@ -675,7 +675,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	      OPTINFO_VECT_FAILURE
 		<< ("Build SLP failed: not GIMPLE_ASSIGN nor "
 		    "GIMPLE_CALL ")
 		<< stmt;
@@ -706,7 +706,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "Build SLP failed: unsupported call type "
 		    << call_stmt;
 		}
@@ -745,7 +745,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 		  if (!optab)
 		    {
 		      if (optinfo_enabled_p ())
-			EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+			OPTINFO_VECT_FAILURE
 			  << "Build SLP failed: no optab";
 		      /* Fatal mismatch.  */
 		      matches[0] = false;
@@ -755,7 +755,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 		  if (icode == CODE_FOR_nothing)
 		    {
 		      if (optinfo_enabled_p ())
-			EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+			OPTINFO_VECT_FAILURE
 			  << ("Build SLP failed: "
 			      "op not supported by target");
 		      /* Fatal mismatch.  */
@@ -802,7 +802,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("Build SLP failed: different operation "
 			"in stmt ")
 		    << stmt
@@ -818,7 +818,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("Build SLP failed: different shift "
 			"arguments in ")
 		    << stmt;
@@ -838,7 +838,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< "Build SLP failed: different calls in "
 			<< stmt;
 		    }
@@ -868,7 +868,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
                     {
                       if (optinfo_enabled_p ())
                         {
-			  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+			  OPTINFO_VECT_FAILURE
 			    <<  ("Build SLP failed: different "
 				 "interleaving chains in one node ")
 			    << stmt;
@@ -888,7 +888,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	      /* Not grouped load.  */
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "Build SLP failed: not grouped load "
 		    << stmt;
 		}
@@ -908,7 +908,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "Build SLP failed: operation unsupported "
 		    << stmt;
 		}
@@ -945,7 +945,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 		{
 		  if (optinfo_enabled_p ())
 		    {
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		      OPTINFO_VECT_FAILURE
 			<< "Build SLP failed: different operation"
 			<< stmt;
 		    }
@@ -972,7 +972,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
       if (!nunits.is_constant (&count))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+	    OPTINFO_VECT_FAILURE
 	      << ("Build SLP failed: different operations "
 		  "not allowed with variable-length SLP");
 	  return false;
@@ -994,7 +994,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 		matches[i] = false;
 		if (optinfo_enabled_p ())
 		  {
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		    OPTINFO_VECT_FAILURE
 		      << ("Build SLP failed: different operation "
 			  "in stmt ")
 		      << stmts[i]
@@ -1246,7 +1246,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
 		    vect_free_slp_tree (grandchild);
 		  SLP_TREE_CHILDREN (child).truncate (0);
 
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+		  OPTINFO_VECT_REMARK << optinfo_printf (
 				   "Building parent vector operands from "
 				   "scalars instead\n");
 		  oprnd_info->def_stmts = vNULL;
@@ -1276,7 +1276,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
 	     scalar version.  */
 	  && !is_pattern_stmt_p (vinfo_for_stmt (stmt)))
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "Building vector operands from scalars\n");
 	  child = vect_create_new_slp_node (oprnd_info->def_stmts);
 	  SLP_TREE_DEF_TYPE (child) = vect_external_def;
@@ -1334,7 +1334,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
 			{
 			  if (optinfo_enabled_p ())
 			    {
-			      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+			      OPTINFO_VECT_FAILURE
 				<< ("Build SLP failed: cannot swap "
 				    "operands of shared stmt ")
 				<< stmts[j];
@@ -1349,7 +1349,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
 	  while (j != group_size);
 
 	  /* Swap mismatched definition stmts.  */
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "Re-trying with swapped operands of stmts ");
 	  for (j = 0; j < group_size; ++j)
 	    if (matches[j] == !swap_not_matching)
@@ -1424,7 +1424,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
 			vect_free_slp_tree (grandchild);
 		      SLP_TREE_CHILDREN (child).truncate (0);
 
-		      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+		      OPTINFO_VECT_REMARK << optinfo_printf (
 				       "Building parent vector operands from "
 				       "scalars instead\n");
 		      oprnd_info->def_stmts = vNULL;
@@ -1644,7 +1644,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn)
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "Load permutation ");
+      OPTINFO_VECT_REMARK << optinfo_printf ( "Load permutation ");
       FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (slp_instn), i, node)
 	if (node->load_permutation.exists ())
 	  FOR_EACH_VEC_ELT (node->load_permutation, j, next)
@@ -1719,7 +1719,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn)
 	      if (!TYPE_VECTOR_SUBPARTS (vectype).is_constant (&nunits)
 		  || maxk >= (GROUP_SIZE (group_info) & ~(nunits - 1)))
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << ("BB vectorization with gaps at the end of "
 			"a load is not supported");
 		  return false;
@@ -1731,7 +1731,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn)
 	      if (!vect_transform_slp_perm_load (node, tem, NULL,
 						 1, slp_instn, true, &n_perms))
 		{
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+		  OPTINFO_VECT_FAILURE
 		    << "unsupported load permutation";
 		  return false;
 		}
@@ -2100,7 +2100,7 @@ vect_split_slp_store_group (gimple *first_stmt, unsigned group1_size)
   GROUP_GAP (first_vinfo) += group2_size;
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "Split group into %d and %d\n",
+    OPTINFO_VECT_REMARK << optinfo_printf ( "Split group into %d and %d\n",
 		     group1_size, group2_size);
 
   return group2;
@@ -2159,7 +2159,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
     {
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+          OPTINFO_VECT_FAILURE << optinfo_printf (
 			   "Build SLP failed: unsupported data-type ");
           dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, scalar_type);
           dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -2224,7 +2224,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
 	      || const_max_nunits > group_size)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "Build SLP failed: store group "
 				 "size not a multiple of the vector size "
 				 "in basic block SLP\n");
@@ -2288,7 +2288,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
             {
               if (optinfo_enabled_p ())
                 {
-                  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+                  OPTINFO_VECT_FAILURE
 		    << ("Build SLP failed: unsupported load "
 			"permutation ")
 		    << stmt;
@@ -2321,7 +2321,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
 	  if (i == loads.length ())
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "Built SLP cancelled: can use "
 				 "load/store-lanes\n");
 	      vect_free_slp_instance (new_instance);
@@ -2333,7 +2333,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "Final SLP tree for instance:\n");
 	  vect_print_slp_tree (MSG_NOTE, vect_location, node);
 	}
@@ -2474,7 +2474,7 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
 
   if (decided_to_slp && optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+      OPTINFO_VECT_REMARK << optinfo_printf (
 		       "Decided to SLP %d instances. Unrolling factor ",
 		       decided_to_slp);
       dump_dec (MSG_NOTE, unrolling_factor);
@@ -2536,7 +2536,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype)
 	      {
 		if (optinfo_enabled_p ())
 		  {
-		    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "use of SLP "
+		    OPTINFO_VECT_REMARK << optinfo_printf ( "use of SLP "
 				     "def in non-SLP stmt: ");
 		    dump_gimple_stmt (MSG_NOTE, TDF_SLIM, use_stmt, 0);
 		  }
@@ -2550,7 +2550,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype)
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "marking hybrid: ");
+	  OPTINFO_VECT_REMARK << optinfo_printf ( "marking hybrid: ");
 	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
 	}
       STMT_SLP_TYPE (stmt_vinfo) = hybrid;
@@ -2581,7 +2581,7 @@ vect_detect_hybrid_slp_1 (tree *tp, int *, void *data)
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "marking hybrid: ");
+	      OPTINFO_VECT_REMARK << optinfo_printf ( "marking hybrid: ");
 	      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, def_stmt, 0);
 	    }
 	  STMT_SLP_TYPE (vinfo_for_stmt (def_stmt)) = hybrid;
@@ -2743,7 +2743,7 @@ vect_slp_analyze_node_operations (vec_info *vinfo, slp_tree node,
       tree scalar_type = TREE_TYPE (gimple_get_lhs (stmt));
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "get vectype for scalar type:  ");
 	  dump_generic_expr (MSG_NOTE, TDF_SLIM, scalar_type);
 	  dump_printf (MSG_NOTE, "\n");
@@ -2754,7 +2754,7 @@ vect_slp_analyze_node_operations (vec_info *vinfo, slp_tree node,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	      OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "not SLPed: unsupported data-type ");
 	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
 				 scalar_type);
@@ -2765,7 +2765,7 @@ vect_slp_analyze_node_operations (vec_info *vinfo, slp_tree node,
 
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "vectype:  ");
+	  OPTINFO_VECT_REMARK << optinfo_printf ( "vectype:  ");
 	  dump_generic_expr (MSG_NOTE, TDF_SLIM, vectype);
 	  dump_printf (MSG_NOTE, "\n");
 	}
@@ -2833,7 +2833,7 @@ vect_slp_analyze_operations (vec_info *vinfo)
 					     SLP_INSTANCE_TREE (instance),
 					     instance))
         {
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	  OPTINFO_VECT_REMARK
 	    << "removing SLP instance operations starting from: "
 	    << SLP_TREE_SCALAR_STMTS (SLP_INSTANCE_TREE (instance))[0];
 	  vect_free_slp_instance (instance);
@@ -2971,7 +2971,7 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
 
   if (optinfo_enabled_p ())
     {
-      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf ( "Cost model analysis: \n");
+      OPTINFO_VECT_REMARK << optinfo_printf ( "Cost model analysis: \n");
       dump_printf (MSG_NOTE, "  Vector inside of basic block cost: %d\n",
 		   vec_inside_cost);
       dump_printf (MSG_NOTE, "  Vector prologue cost: %d\n", vec_prologue_cost);
@@ -3011,7 +3011,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (n_stmts > PARAM_VALUE (PARAM_SLP_MAX_INSNS_IN_BB))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: too many instructions in "
 			 "basic block.\n");
       free_data_refs (datarefs);
@@ -3029,7 +3029,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (!vect_analyze_data_refs (bb_vinfo, &min_vf))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: unhandled data-ref in basic "
 			 "block");
 
@@ -3040,7 +3040,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (BB_VINFO_DATAREFS (bb_vinfo).length () < 2)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: not enough data-refs in "
 			 "basic block");
 
@@ -3051,7 +3051,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (!vect_analyze_data_ref_accesses (bb_vinfo))
     {
      if (optinfo_enabled_p ())
-       EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+       OPTINFO_VECT_FAILURE << optinfo_printf (
 			"not vectorized: unhandled data access in "
 			"basic block");
 
@@ -3065,7 +3065,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (bb_vinfo->grouped_stores.is_empty ())
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: no grouped stores in "
 			 "basic block.\n");
 
@@ -3084,9 +3084,9 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	  OPTINFO_VECT_FAILURE << optinfo_printf (
 			   "Failed to SLP the basic block.\n");
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf ( 
+	  OPTINFO_VECT_FAILURE << optinfo_printf ( 
 			   "not vectorized: failed to find SLP opportunities "
 			   "in basic block.\n");
 	}
@@ -3104,7 +3104,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
       if (! vect_slp_analyze_and_verify_instance_alignment (instance)
 	  || ! vect_slp_analyze_instance_dependence (instance))
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+	  OPTINFO_VECT_REMARK << optinfo_printf (
 			   "removing SLP instance operations starting from: ");
 	  dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
 			    SLP_TREE_SCALAR_STMTS
@@ -3130,7 +3130,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
   if (!vect_slp_analyze_operations (bb_vinfo))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: bad operation in basic block.\n");
 
       delete bb_vinfo;
@@ -3142,7 +3142,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
       && !vect_bb_vectorization_profitable_p (bb_vinfo))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not vectorized: vectorization is not "
 			 "profitable.\n");
 
@@ -3151,7 +3151,7 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin,
     }
 
   if (optinfo_enabled_p ())
-    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) << optinfo_printf (
+    OPTINFO_VECT_REMARK << optinfo_printf (
 		     "Basic block will be vectorized using SLP\n");
 
   return bb_vinfo;
@@ -3222,13 +3222,13 @@ vect_slp_bb (basic_block bb)
 	  && dbg_cnt (vect_slp))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "SLPing BB part";
 
 	  vect_schedule_slp (bb_vinfo);
 
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK)
+	    OPTINFO_VECT_REMARK
 	      << "basic block part vectorized";
 
 	  vectorized = true;
@@ -3267,7 +3267,7 @@ 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_VECT_REMARK
 		<< "***** Re-trying analysis with vector size ";
 	      // FIXME:
 	      dump_dec (MSG_NOTE, current_vector_size);
@@ -3932,9 +3932,8 @@ vect_transform_slp_perm_load (slp_tree node, vec<tree> dr_chain,
 	      if (optinfo_enabled_p ())
 		{
 		  // FIXME: would be better to use "stmt" for location here:
-                  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
-		    << ("permutation requires at "
-			"least three vectors ")
+                  OPTINFO_VECT_FAILURE
+		    << "permutation requires at least three vectors "
 		    << stmt;
 		}
 	      gcc_assert (analyze_only);
@@ -4234,7 +4233,7 @@ vect_schedule_slp (vec_info *vinfo)
       is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
                                              instance, bst_map);
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_REMARK) 
+	OPTINFO_VECT_REMARK 
 	  << "vectorizing stmts using SLP";
     }
   delete bst_map;
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 40c5825..6558330 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -266,7 +266,7 @@ is_simple_and_all_uses_invariant (gimple *stmt, loop_vec_info loop_vinfo)
       if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &dt))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -468,7 +468,7 @@ process_use (gimple *stmt, tree use, loop_vec_info loop_vinfo,
   if (!vect_is_simple_use (use, loop_vinfo, &def_stmt, &dt))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "not vectorized: unsupported use in stmt.\n");
       return false;
     }
@@ -707,7 +707,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
 		&& relevant != vect_used_only_live)
 	      {
 		if (optinfo_enabled_p ())
-		  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		  OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "unsupported use of reduction.\n");
 		return false;
 	      }
@@ -719,7 +719,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
 		&& relevant != vect_used_in_outer)
               {
                 if (optinfo_enabled_p ())
-                  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+                  OPTINFO_VECT_FAILURE << optinfo_printf (
                                    "unsupported use of nested cycle.\n");
 
                 return false;
@@ -732,7 +732,7 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
 		&& relevant != vect_used_only_live)
               {
                 if (optinfo_enabled_p ())
-                  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+                  OPTINFO_VECT_FAILURE << optinfo_printf (
                                    "unsupported use of double reduction.\n");
 
                 return false;
@@ -1016,7 +1016,7 @@ vect_get_store_cost (struct data_reference *dr, int ncopies,
         *inside_cost = VECT_MAX_COST;
 
         if (optinfo_enabled_p ())
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+          OPTINFO_VECT_FAILURE << optinfo_printf (
                            "vect_model_store_cost: unsupported access.\n");
         break;
       }
@@ -1209,7 +1209,7 @@ vect_get_load_cost (struct data_reference *dr, int ncopies,
         *inside_cost = VECT_MAX_COST;
 
         if (optinfo_enabled_p ())
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+          OPTINFO_VECT_FAILURE << optinfo_printf (
                            "vect_model_load_cost: unsupported access.\n");
         break;
       }
@@ -1748,7 +1748,7 @@ check_load_store_masking (loop_vec_info loop_vinfo, tree vectype,
 	  : !vect_store_lanes_supported (vectype, group_size, true))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "can't use a fully-masked loop because the"
 			     " target doesn't have an appropriate masked"
 			     " load/store-lanes instruction.\n");
@@ -1772,7 +1772,7 @@ check_load_store_masking (loop_vec_info loop_vinfo, tree vectype,
 						   gs_info->scale))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "can't use a fully-masked loop because the"
 			     " target doesn't have an appropriate masked"
 			     " gather load or scatter store instruction.\n");
@@ -1790,7 +1790,7 @@ check_load_store_masking (loop_vec_info loop_vinfo, tree vectype,
       /* Element X of the data must come from iteration i * VF + X of the
 	 scalar loop.  We need more work to support other mappings.  */
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "can't use a fully-masked loop because an access"
 			 " isn't contiguous.\n");
       LOOP_VINFO_CAN_FULLY_MASK_P (loop_vinfo) = false;
@@ -1804,7 +1804,7 @@ check_load_store_masking (loop_vec_info loop_vinfo, tree vectype,
       || !can_vec_mask_load_store_p (vecmode, mask_mode, is_load))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "can't use a fully-masked loop because the target"
 			 " doesn't have the appropriate masked load or"
 			 " store.\n");
@@ -2099,7 +2099,7 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp,
 	  overrun_p = loop_vinfo && gap != 0;
 	  if (overrun_p && vls_type != VLS_LOAD)
 	    {
-	      EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	      OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "Grouped store with gaps requires"
 			       " non-consecutive accesses\n");
 	      return false;
@@ -2115,7 +2115,7 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp,
 	  if (overrun_p && !can_overrun_p)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "Peeling for outer loop is not supported\n");
 	      return false;
 	    }
@@ -2201,7 +2201,7 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp,
 	  if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				       "use not simple");
 	      return false;
 	    }
@@ -2213,7 +2213,7 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp,
     {
       gcc_assert (can_overrun_p);
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "Data access with gaps requires scalar "
 			 "epilogue loop\n");
       LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo) = true;
@@ -2238,7 +2238,7 @@ get_negative_load_store_type (gimple *stmt, tree vectype,
   if (ncopies > 1)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "multiple types with negative step.\n");
       return VMAT_ELEMENTWISE;
     }
@@ -2248,7 +2248,7 @@ get_negative_load_store_type (gimple *stmt, tree vectype,
       && alignment_support_scheme != dr_unaligned_supported)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "negative step but alignment required.\n");
       return VMAT_ELEMENTWISE;
     }
@@ -2265,7 +2265,7 @@ get_negative_load_store_type (gimple *stmt, tree vectype,
   if (!perm_mask_for_reverse (vectype))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "negative step and reversing not supported.\n");
       return VMAT_ELEMENTWISE;
     }
@@ -2304,7 +2304,7 @@ get_load_store_type (gimple *stmt, tree vectype, bool slp, bool masked_p,
 				    &gs_info->offset_vectype))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "%s index use not simple.\n",
 			     vls_type == VLS_LOAD ? "gather" : "scatter");
 	  return false;
@@ -2346,7 +2346,7 @@ get_load_store_type (gimple *stmt, tree vectype, bool slp, bool masked_p,
       && !nunits.is_constant ())
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "Not using elementwise accesses due to variable "
 			 "vectorization factor.\n");
       return false;
@@ -2362,7 +2362,7 @@ get_load_store_type (gimple *stmt, tree vectype, bool slp, bool masked_p,
 	   && !pow2p_hwi (GROUP_SIZE (stmt_info))))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not falling back to elementwise accesses\n");
       return false;
     }
@@ -2382,7 +2382,7 @@ vect_check_load_store_mask (gimple *stmt, tree mask,
   if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (mask)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "mask argument is not a boolean.\n");
       return false;
     }
@@ -2390,7 +2390,7 @@ vect_check_load_store_mask (gimple *stmt, tree mask,
   if (TREE_CODE (mask) != SSA_NAME)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "mask argument is not an SSA name.\n");
       return false;
     }
@@ -2403,7 +2403,7 @@ vect_check_load_store_mask (gimple *stmt, tree mask,
 			   &mask_vectype))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "mask use not simple");
       return false;
     }
@@ -2415,7 +2415,7 @@ vect_check_load_store_mask (gimple *stmt, tree mask,
   if (!mask_vectype || !VECTOR_BOOLEAN_TYPE_P (mask_vectype))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "could not find an appropriate vector mask type.\n");
       return false;
     }
@@ -2425,7 +2425,7 @@ vect_check_load_store_mask (gimple *stmt, tree mask,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	  OPTINFO_VECT_FAILURE << optinfo_printf (
 			   "vector mask type ");
 	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, mask_vectype);
 	  dump_printf (MSG_MISSED_OPTIMIZATION,
@@ -2455,7 +2455,7 @@ vect_check_store_rhs (gimple *stmt, tree rhs, vect_def_type *rhs_dt_out,
   if (CONSTANT_CLASS_P (rhs) && native_encode_expr (rhs, NULL, 64) == 0)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "cannot encode constant as a byte sequence");
       return false;
     }
@@ -2468,7 +2468,7 @@ vect_check_store_rhs (gimple *stmt, tree rhs, vect_def_type *rhs_dt_out,
 			   &rhs_vectype))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -2477,7 +2477,7 @@ vect_check_store_rhs (gimple *stmt, tree rhs, vect_def_type *rhs_dt_out,
   if (rhs_vectype && !useless_type_conversion_p (vectype, rhs_vectype))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "incompatible vector types");
       return false;
     }
@@ -3063,7 +3063,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 	  && !types_compatible_p (rhs_type, TREE_TYPE (op)))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "argument types differ");
 	  return false;
 	}
@@ -3073,7 +3073,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
       if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt[i], &opvectype))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -3084,7 +3084,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 	       && opvectype != vectype_in)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "argument vector types differ");
 	  return false;
 	}
@@ -3099,7 +3099,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
     {
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+          OPTINFO_VECT_FAILURE << optinfo_printf (
                            "no vectype for scalar type ");
           dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
           dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -3124,7 +3124,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   if (gimple_vuse (stmt))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "function reads from or writes to memory.\n");
       return false;
     }
@@ -3182,7 +3182,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
       else
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "function is not vectorizable.\n");
 	  return false;
 	}
@@ -3662,7 +3662,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
 	  || thisarginfo.dt == vect_uninitialized_def)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -3737,7 +3737,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!LOOP_VINFO_VECT_FACTOR (loop_vinfo).is_constant (&vf))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "not considering SIMD clones; not yet supported"
 			 " for variable-width vectors.\n");
       return NULL;
@@ -4518,7 +4518,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
 	      && !type_has_mode_precision_p (rhs_type))))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "type conversion to/from bit-precision unsupported");
       return false;
     }
@@ -4527,7 +4527,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype_in))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -4547,7 +4547,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!ok)
 	{
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+            OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -4563,7 +4563,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	  OPTINFO_VECT_FAILURE << optinfo_printf (
                            "no vectype for scalar type ");
 	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
           dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -4577,7 +4577,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
     {
       if (optinfo_enabled_p ())
 	{
-	  EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	  OPTINFO_VECT_FAILURE << optinfo_printf (
                            "can't convert between boolean and non "
 			   "boolean vectors");
 	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
@@ -4630,7 +4630,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
       /* FALLTHRU */
     unsupported:
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
                          "conversion not supported by target.\n");
       return false;
 
@@ -5099,7 +5099,7 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt[0], &vectype_in))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -5131,7 +5131,7 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
 	  || !VECTOR_BOOLEAN_TYPE_P (vectype_in)))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "type conversion to/from bit-precision "
                          "unsupported.\n");
       return false;
@@ -5296,7 +5296,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!type_has_mode_precision_p (TREE_TYPE (scalar_dest)))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "bit-precision shifts not supported.\n");
       return false;
     }
@@ -5305,7 +5305,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -5318,7 +5318,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vectype)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "no vectype for scalar type\n");
       return false;
     }
@@ -5332,7 +5332,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1], &op1_vectype))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -5384,7 +5384,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   else
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "operand mode requires invariant argument.\n");
       return false;
     }
@@ -5403,7 +5403,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
 	  || TYPE_MODE (op1_vectype) != TYPE_MODE (vectype))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
                              "unusable type for last operand in"
                              " vector/vector shift/rotate.\n");
 	  return false;
@@ -5448,7 +5448,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
 			 != TYPE_MODE (TREE_TYPE (op1)))
 		    {
                       if (optinfo_enabled_p ())
-                        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+                        OPTINFO_VECT_FAILURE << optinfo_printf (
                                          "unusable type for last operand in"
                                          " vector/vector shift/rotate.\n");
 		      return false;
@@ -5468,7 +5468,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!optab)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "no optab.\n");
       return false;
     }
@@ -5477,7 +5477,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
   if (icode == CODE_FOR_nothing)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "op not supported by target.\n");
       /* Check only during analysis.  */
       if (maybe_ne (GET_MODE_SIZE (vec_mode), UNITS_PER_WORD)
@@ -5495,7 +5495,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
       && !vect_worthwhile_without_simd_p (vinfo, code))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "not worthwhile without SIMD support.\n");
       return false;
     }
@@ -5664,7 +5664,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
   if (op_type != unary_op && op_type != binary_op && op_type != ternary_op)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "num. args = %d (not unary/binary/ternary op).\n",
                          op_type);
       return false;
@@ -5683,7 +5683,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
       && code != BIT_AND_EXPR)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "bit-precision arithmetic not supported.\n");
       return false;
     }
@@ -5692,7 +5692,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
 			       "use not simple");
       return false;
     }
@@ -5710,7 +5710,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
 	  if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (scalar_dest)))
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "not supported operation on bool value.\n");
 	      return false;
 	    }
@@ -5725,7 +5725,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
     {
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+          OPTINFO_VECT_FAILURE << optinfo_printf (
                            "no vectype for scalar type ");
           dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
                              TREE_TYPE (op0));
@@ -5746,7 +5746,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1]))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -5757,7 +5757,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!vect_is_simple_use (op2, vinfo, &def_stmt, &dt[2]))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 				   "use not simple");
 	  return false;
 	}
@@ -5789,7 +5789,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!optab)
 	{
           if (optinfo_enabled_p ())
-            EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+            OPTINFO_VECT_FAILURE << optinfo_printf (
                              "no optab.\n");
 	  return false;
 	}
@@ -5800,7 +5800,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!target_support_p)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
                          "op not supported by target.\n");
       /* Check only during analysis.  */
       if (maybe_ne (GET_MODE_SIZE (vec_mode), UNITS_PER_WORD)
@@ -5817,7 +5817,7 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
       && !vect_worthwhile_without_simd_p (vinfo, code))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "not worthwhile without SIMD support.\n");
       return false;
     }
@@ -6113,7 +6113,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
       if (slp_node != NULL)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "SLP of masked stores not supported.\n");
 	  return false;
 	}
@@ -6159,7 +6159,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   if (loop && nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "multiple types in nested loop.\n");
       return false;
     }
@@ -6191,7 +6191,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 	       && (memory_access_type != VMAT_GATHER_SCATTER || gs_info.decl))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "unsupported access type for masked store.\n");
 	  return false;
 	}
@@ -7276,7 +7276,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
       if (slp_node != NULL)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "SLP of masked loads not supported.\n");
 	  return false;
 	}
@@ -7320,7 +7320,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   if (nested_in_vect_loop && ncopies > 1)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "multiple types in nested loop.\n");
       return false;
     }
@@ -7333,7 +7333,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 		   STMT_VINFO_MIN_NEG_DIST (stmt_info)))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "cannot perform implicit CSE when unrolling "
 			 "with negative dependence distance\n");
       return false;
@@ -7347,7 +7347,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   if (optab_handler (mov_optab, mode) == CODE_FOR_nothing)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "Aligned load, but unsupported type.\n");
       return false;
     }
@@ -7374,7 +7374,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 		       STMT_VINFO_MIN_NEG_DIST (stmt_info)))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "cannot perform implicit CSE when performing "
 			     "group loads with negative dependence distance\n");
 	  return false;
@@ -7389,7 +7389,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 				 (STMT_VINFO_GROUP_SAME_DR_STMT (stmt_info)))))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "conflicting SLP types for CSEd load\n");
 	  return false;
 	}
@@ -7420,7 +7420,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 	  if (TREE_CODE (masktype) == INTEGER_TYPE)
 	    {
 	      if (optinfo_enabled_p ())
-		EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+		OPTINFO_VECT_FAILURE << optinfo_printf (
 				 "masked gather with integer mask not"
 				 " supported.");
 	      return false;
@@ -7430,7 +7430,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
 	       && memory_access_type != VMAT_GATHER_SCATTER)
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "unsupported access type for masked load.\n");
 	  return false;
 	}
@@ -8551,7 +8551,7 @@ vectorizable_condition (gimple *stmt, gimple_stmt_iterator *gsi,
       if (STMT_VINFO_LIVE_P (stmt_info))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
 			     "value used after loop.\n");
 	  return false;
 	}
@@ -8953,7 +8953,7 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
   if (STMT_VINFO_LIVE_P (stmt_info))
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	OPTINFO_VECT_FAILURE << optinfo_printf (
 			 "value used after loop.\n");
       return false;
     }
@@ -9218,7 +9218,7 @@ vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node,
   if (gimple_has_volatile_ops (stmt))
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+        OPTINFO_VECT_FAILURE << optinfo_printf (
                          "not vectorized: stmt has volatile operands\n");
 
       return false;
@@ -9388,7 +9388,7 @@ vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node,
     {
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+          OPTINFO_VECT_FAILURE
 	    << "not vectorized: relevant stmt not supported: "
 	    << stmt;
         }
@@ -9406,7 +9406,7 @@ vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node,
     {
       if (optinfo_enabled_p ())
         {
-          EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE)
+          OPTINFO_VECT_FAILURE
 	    << "not vectorized: live stmt not supported: "
 	    << stmt;
         }
@@ -9524,7 +9524,7 @@ vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
       if (!STMT_VINFO_LIVE_P (stmt_info))
 	{
 	  if (optinfo_enabled_p ())
-	    EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
+	    OPTINFO_VECT_FAILURE << optinfo_printf (
                              "stmt not supported.\n");
 	  gcc_unreachable ();
 	}
@@ -9892,10 +9892,9 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
 
   if (optinfo_enabled_p ())
     {
-      dump_printf_loc (MSG_NOTE, vect_location,
-                       "vect_is_simple_use: operand ");
-      dump_generic_expr (MSG_NOTE, TDF_SLIM, operand);
-      dump_printf (MSG_NOTE, "\n");
+      OPTINFO_VECT_REMARK
+	<< "vect_is_simple_use: operand "
+	<< slim (operand);
     }
 
   if (CONSTANT_CLASS_P (operand))
@@ -9913,8 +9912,8 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
   if (TREE_CODE (operand) != SSA_NAME)
     {
       if (optinfo_enabled_p ())
-	EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
-			 "not ssa-name.\n");
+	OPTINFO_VECT_FAILURE
+	  << "not ssa-name";
       return false;
     }
 
@@ -9927,8 +9926,8 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
   *def_stmt = SSA_NAME_DEF_STMT (operand);
   if (optinfo_enabled_p ())
     {
-      dump_printf_loc (MSG_NOTE, vect_location, "def_stmt: ");
-      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, *def_stmt, 0);
+      OPTINFO_VECT_REMARK
+	<< "def_stmt: " << *def_stmt;
     }
 
   if (! vect_stmt_in_region_p (vinfo, *def_stmt))
@@ -9941,35 +9940,35 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
 
   if (optinfo_enabled_p ())
     {
-      dump_printf_loc (MSG_NOTE, vect_location, "type of def: ");
+      pending_optinfo po = OPTINFO_VECT_REMARK << "type of def: ";
       switch (*dt)
 	{
 	case vect_uninitialized_def:
-	  dump_printf (MSG_NOTE, "uninitialized\n");
+	  po << "uninitialized";
 	  break;
 	case vect_constant_def:
-	  dump_printf (MSG_NOTE, "constant\n");
+	  po << "constant";
 	  break;
 	case vect_external_def:
-	  dump_printf (MSG_NOTE, "external\n");
+	  po << "external";
 	  break;
 	case vect_internal_def:
-	  dump_printf (MSG_NOTE, "internal\n");
+	  po << "internal";
 	  break;
 	case vect_induction_def:
-	  dump_printf (MSG_NOTE, "induction\n");
+	  po << "induction";
 	  break;
 	case vect_reduction_def:
-	  dump_printf (MSG_NOTE, "reduction\n");
+	  po << "reduction";
 	  break;
 	case vect_double_reduction_def:
-	  dump_printf (MSG_NOTE, "double reduction\n");
+	  po << "double reduction";
 	  break;
 	case vect_nested_cycle:
-	  dump_printf (MSG_NOTE, "nested cycle\n");
+	  po << "nested cycle";
 	  break;
 	case vect_unknown_def_type:
-	  dump_printf (MSG_NOTE, "unknown\n");
+	  po << "unknown";
 	  break;
 	}
     }
@@ -9977,8 +9976,7 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
   if (*dt == vect_unknown_def_type)
     {
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
-                         "Unsupported pattern.\n");
+        OPTINFO_VECT_FAILURE << "Unsupported pattern";
       return false;
     }
 
@@ -9990,8 +9988,7 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
       break;
     default:
       if (optinfo_enabled_p ())
-        EMIT_OPTINFO_AT_VECT_LOCATION (OPT_RECORD_FAILURE) << optinfo_printf (
-                         "unsupported defining stmt:\n");
+        OPTINFO_VECT_FAILURE << "unsupported defining stmt:";
       return false;
     }
 
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 5411b37..206f0f3 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1393,8 +1393,22 @@ extern pending_optinfo
 emit_optinfo_at_vect_location (const location &impl_location,
 			       enum opt_record_kind kind);
 
-#define EMIT_OPTINFO_AT_VECT_LOCATION(KIND) \
-  (emit_optinfo_at_vect_location (OPTINFO_IMPL_LOCATION, (KIND)))
+/* Emit that a successful optimization happened at the vect location.  */
+
+#define OPTINFO_VECT_SUCCESS \
+  (emit_optinfo_at_vect_location (OPTINFO_IMPL_LOCATION, OPT_RECORD_SUCCESS))
+
+/* Emit that a failed optimization happened at the vect location.  */
+
+#define OPTINFO_VECT_FAILURE \
+  (emit_optinfo_at_vect_location (OPTINFO_IMPL_LOCATION, OPT_RECORD_FAILURE))
+
+/* Emit a remark relating to an optimization at the vect location.  */
+
+#define OPTINFO_VECT_REMARK \
+  (emit_optinfo_at_vect_location (OPTINFO_IMPL_LOCATION, OPT_RECORD_REMARK))
+
+/* FIXME.  */
 
 #define VECT_OPTINFO_SCOPE(NAME) \
   OPTINFO_SCOPE ((NAME), vect_location_thing)
-- 
1.8.5.3

