From: Richard Biener Date: Fri, 3 Jul 2026 11:18:43 +0000 (+0200) Subject: Make BB SLP costing more verbose X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f3003fe7223765ea9ba285a1edecb15f6b5cb65;p=thirdparty%2Fgcc.git Make BB SLP costing more verbose 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. --- diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 2250f6f74a1..6081948fed4 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -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 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 ()) {