aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-03-27 10:53:11 +0100
committerRichard Biener <rguenther@suse.de>2024-05-02 15:30:17 +0200
commitbf33fe90e75c2c463d77f83d9a44dc61abe087f5 (patch)
tree59bfedde97b7c3f8360c6fef663d32f7a20eaa87 /gcc/tree-vect-slp.cc
parent9b5c0be59d0f94df0517820f00b4520b5abddd8c (diff)
downloadgcc-bf33fe90e75c2c463d77f83d9a44dc61abe087f5.zip
gcc-bf33fe90e75c2c463d77f83d9a44dc61abe087f5.tar.gz
gcc-bf33fe90e75c2c463d77f83d9a44dc61abe087f5.tar.bz2
Improve SLP dump and graph
The following notes which lanes are considered live and adds an overload to produce a graphviz graph for multiple entries into an SLP graph. * tree-vect-slp.cc (vect_print_slp_tree): Mark live lanes. (dot_slp_tree): New overload for multiple entries.
Diffstat (limited to 'gcc/tree-vect-slp.cc')
-rw-r--r--gcc/tree-vect-slp.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 133606f..3eb326d 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -2759,7 +2759,9 @@ vect_print_slp_tree (dump_flags_t dump_kind, dump_location_t loc,
}
if (SLP_TREE_SCALAR_STMTS (node).exists ())
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- dump_printf_loc (metadata, user_loc, "\tstmt %u %G", i, stmt_info->stmt);
+ dump_printf_loc (metadata, user_loc, "\t%sstmt %u %G",
+ STMT_VINFO_LIVE_P (stmt_info) ? "[l] " : "",
+ i, stmt_info->stmt);
else
{
dump_printf_loc (metadata, user_loc, "\t{ ");
@@ -2840,6 +2842,23 @@ dot_slp_tree (const char *fname, slp_tree node)
fclose (f);
}
+DEBUG_FUNCTION void
+dot_slp_tree (const char *fname, const vec<slp_instance> &slp_instances)
+{
+ FILE *f = fopen (fname, "w");
+ fprintf (f, "digraph {\n");
+ fflush (f);
+ {
+ debug_dump_context ctx (f);
+ hash_set<slp_tree> visited;
+ for (auto inst : slp_instances)
+ dot_slp_tree (f, SLP_INSTANCE_TREE (inst), visited);
+ }
+ fflush (f);
+ fprintf (f, "}\n");
+ fclose (f);
+}
+
/* Dump a slp tree NODE using flags specified in DUMP_KIND. */
static void