]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make BB SLP costing more verbose
authorRichard Biener <rguenther@suse.de>
Fri, 3 Jul 2026 11:18:43 +0000 (13:18 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 3 Jul 2026 12:36:52 +0000 (14:36 +0200)
The following also dumps the costs for parts of the SLP graph that
are associated with another loop when there's one that was not
profitable.  It also prints markers to where scalar/vector parts
start for easier debugging.

* tree-vect-slp.cc (vect_bb_vectorization_profitable_p): Make
profitabilty decision easier to debug.

gcc/tree-vect-slp.cc

index 2250f6f74a1ae63b0b9e42559955c0ab77ff3135..6081948fed4f80a876fa85ef2c22e103c3a8dbd7 100644 (file)
@@ -9695,6 +9695,9 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
          continue;
        }
 
+      if (dump_enabled_p ())
+       dump_printf_loc (MSG_NOTE, vect_location,
+                        "Scalar cost for part in loop %d\n", sl);
       class vector_costs *scalar_target_cost_data = init_cost (bb_vinfo, true);
       do
        {
@@ -9707,6 +9710,9 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
       scalar_cost = scalar_target_cost_data->body_cost ();
 
       /* Complete the target-specific vector cost calculation.  */
+      if (dump_enabled_p ())
+       dump_printf_loc (MSG_NOTE, vect_location,
+                        "Vector cost for part in loop %d\n", vl);
       class vector_costs *vect_target_cost_data = init_cost (bb_vinfo, false);
       auto_vec<stmt_info_for_cost> tem;
       do
@@ -9741,10 +9747,7 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
         free on the scalar side but cost a load on the vector side for
         example).  */
       if (vec_outside_cost + vec_inside_cost > scalar_cost)
-       {
-         profitable = false;
-         break;
-       }
+       profitable = false;
     }
   if (profitable && vi < li_vector_costs.length ())
     {