dump SLP subgraph before costing

Message ID nycvar.YFH.7.76.2102221041250.11213@elmra.sevgm.obk
State New
Headers show
Series
  • dump SLP subgraph before costing
Related show

Commit Message

Richard Biener Feb. 22, 2021, 9:41 a.m.
This adds another dump of the SLP subgraph we're throwing at costing.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2021-02-22  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Dump
	costed subgraph.
---
 gcc/tree-vect-slp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.26.2

Patch

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index ea8a97b01c6..c521c34a83b 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -4366,6 +4366,15 @@  vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
   unsigned int vec_inside_cost = 0, vec_outside_cost = 0, scalar_cost = 0;
   unsigned int vec_prologue_cost = 0, vec_epilogue_cost = 0;
 
+  if (dump_enabled_p ())
+    {
+      dump_printf_loc (MSG_NOTE, vect_location, "Costing subgraph: \n");
+      hash_set<slp_tree> visited;
+      FOR_EACH_VEC_ELT (slp_instances, i, instance)
+	vect_print_slp_graph (MSG_NOTE, vect_location,
+			      SLP_INSTANCE_TREE (instance), visited);
+    }
+
   /* Calculate scalar cost and sum the cost for the vector stmts
      previously collected.  */
   stmt_vector_for_cost scalar_costs = vNULL;