Skip to content

Commit 931832a

Browse files
committed
improve SLP vect dumping
This adds additional dumping helping in particular basic-block vectorization SLP dump reading plus showing what we actually generate code from. 2020-09-07 Richard Biener <[email protected]> * tree-vect-slp.c (vect_analyze_slp_instance): Dump stmts we start SLP analysis from, failure and splitting. (vect_schedule_slp): Dump SLP graph entry and root stmt we are about to emit code for.
1 parent 3fe3efe commit 931832a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

gcc/tree-vect-slp.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,15 @@ vect_analyze_slp_instance (vec_info *vinfo,
22022202
scalar_stmts.safe_push (next_info);
22032203
}
22042204

2205+
if (dump_enabled_p ())
2206+
{
2207+
dump_printf_loc (MSG_NOTE, vect_location,
2208+
"Starting SLP discovery for\n");
2209+
for (i = 0; i < scalar_stmts.length (); ++i)
2210+
dump_printf_loc (MSG_NOTE, vect_location,
2211+
" %G", scalar_stmts[i]->stmt);
2212+
}
2213+
22052214
/* Build the tree for the SLP instance. */
22062215
bool *matches = XALLOCAVEC (bool, group_size);
22072216
unsigned npermutes = 0;
@@ -2232,6 +2241,10 @@ vect_analyze_slp_instance (vec_info *vinfo,
22322241
return false;
22332242
}
22342243
/* Fatal mismatch. */
2244+
if (dump_enabled_p ())
2245+
dump_printf_loc (MSG_NOTE, vect_location,
2246+
"SLP discovery succeeded but node needs "
2247+
"splitting\n");
22352248
matches[0] = true;
22362249
matches[group_size / const_max_nunits * const_max_nunits] = false;
22372250
vect_free_slp_tree (node, false);
@@ -2374,6 +2387,9 @@ vect_analyze_slp_instance (vec_info *vinfo,
23742387
gcc_assert ((const_nunits & (const_nunits - 1)) == 0);
23752388
unsigned group1_size = i & ~(const_nunits - 1);
23762389

2390+
if (dump_enabled_p ())
2391+
dump_printf_loc (MSG_NOTE, vect_location,
2392+
"Splitting SLP group at stmt %u\n", i);
23772393
stmt_vec_info rest = vect_split_slp_store_group (stmt_info,
23782394
group1_size);
23792395
bool res = vect_analyze_slp_instance (vinfo, bst_map, stmt_info,
@@ -2395,6 +2411,9 @@ vect_analyze_slp_instance (vec_info *vinfo,
23952411
(some) of the remainder. FORNOW ignore this possibility. */
23962412
}
23972413

2414+
/* Failed to SLP. */
2415+
if (dump_enabled_p ())
2416+
dump_printf_loc (MSG_NOTE, vect_location, "SLP discovery failed\n");
23982417
return false;
23992418
}
24002419

@@ -4662,6 +4681,16 @@ vect_schedule_slp (vec_info *vinfo)
46624681
FOR_EACH_VEC_ELT (slp_instances, i, instance)
46634682
{
46644683
slp_tree node = SLP_INSTANCE_TREE (instance);
4684+
if (dump_enabled_p ())
4685+
{
4686+
dump_printf_loc (MSG_NOTE, vect_location,
4687+
"Vectorizing SLP tree:\n");
4688+
if (SLP_INSTANCE_ROOT_STMT (instance))
4689+
dump_printf_loc (MSG_NOTE, vect_location, "Root stmt: %G",
4690+
SLP_INSTANCE_ROOT_STMT (instance)->stmt);
4691+
vect_print_slp_graph (MSG_NOTE, vect_location,
4692+
SLP_INSTANCE_TREE (instance));
4693+
}
46654694
/* Schedule the tree of INSTANCE. */
46664695
vect_schedule_slp_instance (vinfo, node, instance);
46674696

0 commit comments

Comments
 (0)