]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111387 - BB SLP and irreducible regions
authorRichard Biener <rguenther@suse.de>
Wed, 13 Sep 2023 09:04:31 +0000 (11:04 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Sep 2023 11:40:10 +0000 (13:40 +0200)
commit04238615bba435f0b0ca7b263ad2c6bdb596e865
tree8b5310819a5c030e4d2923d7dc79e49d4aa8cafd
parentc0a70df6403397a69204cba1df82114a9ddf7076
tree-optimization/111387 - BB SLP and irreducible regions

When we split an irreducible region for BB vectorization analysis
the defensive handling of external backedge defs in
vect_get_and_check_slp_defs doesn't work since that relies on
dominance info to identify a backedge.  The testcase also shows
we are iterating over the function in a sub-optimal way which is
why we split the irreducible region in the first place.  The fix
is to mark backedges and use EDGE_DFS_BACK to identify them and
to use the region RPO compute which can produce a RPO order keeping
cycles in a better order (and as side effect marks backedges).

PR tree-optimization/111387
* tree-vect-slp.cc (vect_get_and_check_slp_defs): Check
EDGE_DFS_BACK when doing BB vectorization.
(vect_slp_function): Use rev_post_order_and_mark_dfs_back_seme
to compute RPO and mark backedges.

* gcc.dg/torture/pr111387.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr111387.c [new file with mode: 0644]
gcc/tree-vect-slp.cc