From 5e19628bb558330612976b09e615456f2a3b7902 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 10 May 2018 13:28:28 -0400
Subject: [PATCH 31/67] FIXME: more, with some incomplete

---
 gcc/tree-vect-data-refs.c | 218 +++++++++++++++++++++-------------------------
 1 file changed, 101 insertions(+), 117 deletions(-)

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index d2b2275..760b76b 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -340,30 +340,24 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      vect_location_writeln (OPT_RECORD_FAILURE,
-			       "versioning for alias not supported for: "
-			       "can't determine dependence between ");
-	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-				 DR_REF (dra));
-	      dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
-	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-				 DR_REF (drb));
-	      dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
+	      emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+		<< ("versioning for alias not supported for: "
+		    "can't determine dependence between ")
+		<< slim (DR_REF (dra))
+		<< " and "
+		<< slim (DR_REF (drb));
 	    }
 	  return true;
 	}
 
       if (optinfo_enabled_p ())
 	{
-	  vect_location_writeln (OPT_RECORD_FAILURE,
-			   "versioning for alias required: "
-			   "can't determine dependence between ");
-	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-			     DR_REF (dra));
-	  dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
-	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-			     DR_REF (drb));
-	  dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
+	  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	    << ("versioning for alias required: "
+		"can't determine dependence between ")
+	    << slim (DR_REF (dra))
+	    << " and "
+	    << slim (DR_REF (drb));
 	}
 
       /* Add to list of ddrs that need to be tested at run-time.  */
@@ -388,28 +382,24 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	{
 	  if (optinfo_enabled_p ())
 	    {
-	      vect_location_writeln (OPT_RECORD_FAILURE,
-			       "versioning for alias not supported for: "
-			       "bad dist vector for ");
-	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-				 DR_REF (dra));
-	      dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
-	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
-				 DR_REF (drb));
-	      dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
+	      emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+		<< ("versioning for alias not supported for: "
+		    "bad dist vector for ")
+		<< slim (DR_REF (dra))
+		<< " and "
+		<< slim (DR_REF (drb));
 	    }
 	  return true;
 	}
 
       if (optinfo_enabled_p ())
         {
-          vect_location_writeln (OPT_RECORD_FAILURE,
-                           "versioning for alias required: "
-                           "bad dist vector for ");
-          dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, DR_REF (dra));
-          dump_printf (MSG_MISSED_OPTIMIZATION,  " and ");
-          dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, DR_REF (drb));
-          dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
+          emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	    << ("versioning for alias required: "
+		"bad dist vector for ")
+	    << slim (DR_REF (dra))
+	    << " and "
+	    << slim (DR_REF (drb));
         }
       /* Add to list of ddrs that need to be tested at run-time.  */
       return !vect_mark_for_runtime_alias_test (ddr, loop_vinfo);
@@ -463,8 +453,8 @@ 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 ())
-		vect_location_writeln (OPT_RECORD_FAILURE,
-				 "READ_WRITE dependence in interleaving.\n");
+		emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+		  << "READ_WRITE dependence in interleaving";
 	      return true;
 	    }
 
@@ -476,8 +466,8 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 	      else if (integer_zerop (indicator))
 		{
 		  if (optinfo_enabled_p ())
-		    vect_location_writeln (OPT_RECORD_FAILURE,
-				 "access also has a zero step\n");
+		    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+		      << "access also has a zero step";
 		  return true;
 		}
 	    }
@@ -490,8 +480,8 @@ 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 ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
-	                     "dependence distance negative.\n");
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	      << "dependence distance negative";
 	  /* Record a negative dependence distance to later limit the
 	     amount of stmt copying / unrolling we can perform.
 	     Only need to handle read-after-write dependence.  */
@@ -526,13 +516,12 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
 
       if (optinfo_enabled_p ())
 	{
-	  vect_location_writeln (OPT_RECORD_FAILURE,
-	               "not vectorized, possible dependence "
-	               "between data-refs ");
-	  dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dra));
-	  dump_printf (MSG_NOTE,  " and ");
-	  dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (drb));
-	  dump_printf (MSG_NOTE,  "\n");
+	  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	    << ("not vectorized, possible dependence "
+		"between data-refs ")
+	    << slim (DR_REF (dra))
+	    << " and "
+	    << slim (DR_REF (drb));
 	}
 
       return true;
@@ -621,12 +610,11 @@ vect_slp_analyze_data_ref_dependence (struct data_dependence_relation *ddr)
     {
       if  (optinfo_enabled_p ())
 	{
-	  vect_location_writeln (OPT_RECORD_FAILURE,
-			   "can't determine dependence between ");
-	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, DR_REF (dra));
-	  dump_printf (MSG_MISSED_OPTIMIZATION,  " and ");
-	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, DR_REF (drb));
-	  dump_printf (MSG_MISSED_OPTIMIZATION,  "\n");
+	  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	    << "can't determine dependence between "
+	    << slim (DR_REF (dra))
+	    << " and "
+	    << slim (DR_REF (drb));
 	}
     }
   else if (optinfo_enabled_p ())
@@ -908,7 +896,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 	    vect_location_writeln (OPT_RECORD_REMARK,
 			     "inner step divides the vector alignment.\n");
 	  else
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "inner step doesn't divide the vector"
 			     " alignment.\n");
 	}
@@ -925,7 +913,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 ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			 "step doesn't divide the vector alignment.\n");
     }
 
@@ -949,7 +937,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
     {
       if (optinfo_enabled_p ())
 	{
-	  vect_location_writeln (OPT_RECORD_FAILURE,
+	  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 	                   "Unknown alignment for access: ");
 	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, ref);
 	  dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
@@ -1005,24 +993,18 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 			   &const_misalignment))
     {
       if (optinfo_enabled_p ())
-	{
-	  vect_location_writeln (OPT_RECORD_FAILURE,
-			   "Non-constant misalignment for access: ");
-	  dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, ref);
-	  dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
-	}
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	  << "Non-constant misalignment for access: "
+	  << slim (ref);
       return true;
     }
 
   SET_DR_MISALIGNMENT (dr, const_misalignment);
 
   if (optinfo_enabled_p ())
-    {
-      vect_location_writeln (OPT_RECORD_FAILURE,
-                       "misalign = %d bytes of ref ", DR_MISALIGNMENT (dr));
-      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, ref);
-      dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
-    }
+    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+      << optinfo_printf ("misalign = %d bytes of ref ", DR_MISALIGNMENT (dr))
+      << slim (ref);
 
   return true;
 }
@@ -1106,10 +1088,10 @@ verify_data_ref_alignment (data_reference_p dr)
       if (optinfo_enabled_p ())
 	{
 	  if (DR_IS_READ (dr))
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "not vectorized: unsupported unaligned load.");
 	  else
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "not vectorized: unsupported unaligned "
 			     "store.");
 
@@ -1226,7 +1208,7 @@ vector_alignment_reachable_p (struct data_reference *dr)
       if (DR_MISALIGNMENT (dr) % elmsize)
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 	                     "data size does not divide the misalignment.\n");
 	  return false;
 	}
@@ -1237,9 +1219,9 @@ 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 ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
-	                 "Unknown misalignment, %snaturally aligned\n",
-			 is_packed ? "not " : "");
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	  << optinfo_printf ("Unknown misalignment, %snaturally aligned\n",
+			     is_packed ? "not " : "");
       return targetm.vectorize.vector_alignment_reachable (type, is_packed);
     }
 
@@ -1829,7 +1811,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
           if (!aligned_access_p (dr))
             {
               if (optinfo_enabled_p ())
-                vect_location_writeln (OPT_RECORD_FAILURE,
+                emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                  "vector alignment may not be reachable\n");
               break;
             }
@@ -2350,7 +2332,7 @@ vect_analyze_data_refs_alignment (loop_vec_info vinfo)
 	    continue;
 
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "not vectorized: can't calculate alignment "
 			     "for data ref.\n");
 
@@ -2384,7 +2366,7 @@ vect_slp_analyze_and_verify_node_alignment (slp_tree node)
       || ! verify_data_ref_alignment (dr))
     {
       if (optinfo_enabled_p ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			 "not vectorized: bad data alignment in basic "
 			 "block.\n");
       return false;
@@ -2543,13 +2525,13 @@ vect_analyze_group_access_1 (struct data_reference *dr)
               if (DR_IS_WRITE (data_ref))
                 {
                   if (optinfo_enabled_p ())
-                    vect_location_writeln (OPT_RECORD_FAILURE,
+                    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                      "Two store stmts share the same dr.\n");
                   return false;
                 }
 
 	      if (optinfo_enabled_p ())
-		vect_location_writeln (OPT_RECORD_FAILURE,
+		emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				 "Two or more load stmts share the same dr.\n");
 
               /* For load use the same data-ref load.  */
@@ -2577,7 +2559,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	      if (DR_IS_WRITE (data_ref))
 		{
                   if (optinfo_enabled_p ())
-                    vect_location_writeln (OPT_RECORD_FAILURE,
+                    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                      "interleaved store with gaps\n");
 		  return false;
 		}
@@ -2605,7 +2587,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
       if (groupsize > 4096)
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "group is too large\n");
 	  return false;
 	}
@@ -2616,7 +2598,7 @@ vect_analyze_group_access_1 (struct data_reference *dr)
 	  && !DR_IS_READ (dr))
         {
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "interleaved store with gaps\n");
 	  return false;
 	}
@@ -2708,7 +2690,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
   if (loop_vinfo && !step)
     {
       if (optinfo_enabled_p ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 	                 "bad data-ref access in loop\n");
       return false;
     }
@@ -3061,7 +3043,7 @@ vect_analyze_data_ref_accesses (vec_info *vinfo)
         && !vect_analyze_data_ref_access (dr))
       {
 	if (optinfo_enabled_p ())
-	  vect_location_writeln (OPT_RECORD_FAILURE,
+	  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 	                   "not vectorized: complicated access pattern.\n");
 
         if (is_a <bb_vec_info> (vinfo))
@@ -3572,11 +3554,13 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
   if ((int) count > PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS))
     {
       if (optinfo_enabled_p ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
-			 "number of versioning for alias "
-			 "run-time tests exceeds %d "
-			 "(--param vect-max-version-for-alias-checks)\n",
-			 PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS));
+	// FIXME: would be nice to have special highlighting for
+	// command-line options (e.g. params)
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE)
+	  << optinfo_printf ("number of versioning for alias "
+			     "run-time tests exceeds %d "
+			     "(--param vect-max-version-for-alias-checks)",
+			     PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS));
       return false;
     }
 
@@ -3975,7 +3959,7 @@ again:
       if (!dr || !DR_REF (dr))
         {
           if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 	                     "not vectorized: unhandled data-ref\n");
           return false;
         }
@@ -4096,7 +4080,7 @@ again:
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  vect_location_writeln (OPT_RECORD_FAILURE,
+		  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                    "not vectorized: data ref analysis "
                                    "failed ");
 		  dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -4112,7 +4096,7 @@ again:
       if (TREE_CODE (DR_BASE_ADDRESS (dr)) == INTEGER_CST)
         {
           if (optinfo_enabled_p ())
-            vect_location_writeln (OPT_RECORD_FAILURE,
+            emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                              "not vectorized: base addr of dr is a "
                              "constant\n");
 
@@ -4128,7 +4112,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: volatile type ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
             }
@@ -4143,7 +4127,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: statement can throw an "
                                "exception ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -4162,7 +4146,7 @@ again:
 	{
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: statement is bitfield "
                                "access ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -4263,7 +4247,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: more than one data ref "
                                "in stmt: ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -4291,7 +4275,7 @@ again:
 	{
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: base object not addressable "
 			       "for stmt: ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -4314,7 +4298,7 @@ again:
         {
           if (optinfo_enabled_p ())
             {
-              vect_location_writeln (OPT_RECORD_FAILURE,
+              emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                "not vectorized: no vectype for stmt: ");
               dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
               dump_printf (MSG_MISSED_OPTIMIZATION, " scalar_type: ");
@@ -4366,7 +4350,7 @@ again:
 	      free_data_ref (dr);
 	      if (optinfo_enabled_p ())
 		{
-		  vect_location_writeln (OPT_RECORD_FAILURE,
+		  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				   (gatherscatter == GATHER) ?
 				   "not vectorized: not suitable for gather "
 				   "load " :
@@ -4389,7 +4373,7 @@ again:
 	    {
 	      if (optinfo_enabled_p ())
 		{
-		  vect_location_writeln (OPT_RECORD_FAILURE,
+		  emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
                                    "not vectorized: not suitable for strided "
                                    "load ");
 		  dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
@@ -5077,7 +5061,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
   if (count != 3 && exact_log2 (count) == -1)
     {
       if (optinfo_enabled_p ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			 "the size of the group of accesses"
 			 " is not a power of 2 or not eqaul to 3\n");
       return false;
@@ -5096,7 +5080,7 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
 	  if (!GET_MODE_NUNITS (mode).is_constant (&nelt))
 	    {
 	      if (optinfo_enabled_p ())
-		vect_location_writeln (OPT_RECORD_FAILURE,
+		emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				 "cannot handle groups of 3 stores for"
 				 " variable-length vectors\n");
 	      return false;
@@ -5688,7 +5672,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 ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			 "single-element interleaving not supported "
 			 "for not adjacent vector loads\n");
       return false;
@@ -5699,7 +5683,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
   if (count != 3 && exact_log2 (count) == -1)
     {
       if (optinfo_enabled_p ())
-	vect_location_writeln (OPT_RECORD_FAILURE,
+	emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			 "the size of the group of accesses"
 			 " is not a power of 2 or not equal to 3\n");
       return false;
@@ -5715,7 +5699,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	  if (!GET_MODE_NUNITS (mode).is_constant (&nelt))
 	    {
 	      if (optinfo_enabled_p ())
-		vect_location_writeln (OPT_RECORD_FAILURE,
+		emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				 "cannot handle groups of 3 loads for"
 				 " variable-length vectors\n");
 	      return false;
@@ -5736,7 +5720,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    vect_location_writeln (OPT_RECORD_FAILURE,
+		    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				     "shuffle of 3 loads is not supported by"
 				     " target\n");
 		  return false;
@@ -5750,7 +5734,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
 	      if (!can_vec_perm_const_p (mode, indices))
 		{
 		  if (optinfo_enabled_p ())
-		    vect_location_writeln (OPT_RECORD_FAILURE,
+		    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 				     "shuffle of 3 loads is not supported by"
 				     " target\n");
 		  return false;
@@ -5782,7 +5766,7 @@ vect_grouped_load_supported (tree vectype, bool single_element_p,
     }
 
   if (optinfo_enabled_p ())
-    vect_location_writeln (OPT_RECORD_FAILURE,
+    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 		     "extract even/odd not supported by target\n");
   return false;
 }
@@ -6125,7 +6109,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shuffle of 2 fields structure is not \
 			      supported by target\n");
 	  return false;
@@ -6140,7 +6124,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shuffle of 2 fields structure is not \
 			      supported by target\n");
 	  return false;
@@ -6155,7 +6139,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
@@ -6171,7 +6155,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "select is not supported by target\n");
 	  return false;
 	}
@@ -6235,7 +6219,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shuffle of 3 fields structure is not \
 			      supported by target\n");
 	  return false;
@@ -6250,7 +6234,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
@@ -6264,7 +6248,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
@@ -6278,7 +6262,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
@@ -6292,7 +6276,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
       if (!can_vec_perm_const_p (TYPE_MODE (vectype), indices))
 	{
 	  if (optinfo_enabled_p ())
-	    vect_location_writeln (OPT_RECORD_FAILURE,
+	    emit_optinfo_at_vect_location (OPT_RECORD_FAILURE) << (
 			     "shift permutation is not supported by target\n");
 	  return false;
 	}
-- 
1.8.5.3

