tree-optimization/98550 - fix BB vect unrolling check
authorRichard Biener <rguenther@suse.de>
Tue, 12 Jan 2021 10:17:33 +0000 (11:17 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 12 Jan 2021 14:17:24 +0000 (15:17 +0100)
commit52a170b1a1818b7521c25e76271638a448b3f630
tree38a14497f302dc2adf2990fc71c6c4f77a8673ea
parente91910d3576eeac714c93ec25ea3b15012007903
tree-optimization/98550 - fix BB vect unrolling check

This fixes the check that disqualifies BB vectorization because of
required unrolling to match up with the later exact_div we do.  To
not disable the ability to split groups that do not match up
exactly with a choosen vector type this also introduces a soft-fail
mechanism to vect_build_slp_tree_1 which delays failing to after
the matches[] array is populated from other checks and only then
determines the split point according to the vector type.

2021-01-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98550
* tree-vect-slp.c (vect_record_max_nunits): Check whether
the group size is a multiple of the vector element count.
(vect_build_slp_tree_1): When we need to fail because
the vector type choosen causes unrolling do so lazily
without affecting matches only at the end to guide group splitting.

* g++.dg/opt/pr98550.C: New testcase.
gcc/testsuite/g++.dg/opt/pr98550.C [new file with mode: 0644]
gcc/tree-vect-slp.c