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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
* tree-vect-slp.cc (vect_bb_vectorization_profitable_p): Make
profitabilty decision easier to debug.
---
gcc/tree-vect-slp.cc | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
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<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 ())
{
--
2.51.0