]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fall back to single-lane SLP before falling back to no SLP
authorRichard Biener <rguenther@suse.de>
Wed, 18 Sep 2024 10:41:25 +0000 (12:41 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 19 Sep 2024 14:26:28 +0000 (16:26 +0200)
commit77bd23a3e247555ba427d01af8e5713934be8d5b
treee6c1df8f2e40f68e6687b583fb60ade8f4b1c4bb
parentd3a7302ec5985abcda561886cc724d388c7143cb
Fall back to single-lane SLP before falling back to no SLP

The following changes the fallback to disable SLP when any of the
discovered SLP instances failed to pass vectorization checking into
a fallback that emulates what no SLP would do with SLP - force
single-lane discovery for all instances.

The patch does not remove the final fallback to disable SLP but it
reduces the fallout from failing vectorization when any non-SLP
stmt survives analysis.

* tree-vectorizer.h (vect_analyze_slp): Add force_single_lane
parameter.
* tree-vect-slp.cc (vect_analyze_slp_instance): Remove
defaulting of force_single_lane.
(vect_build_slp_instance): Likewise.  Pass down appropriate
force_single_lane.
(vect_analyze_slp): Add force_sigle_lane parameter and pass
it down appropriately.
(vect_slp_analyze_bb_1): Always do multi-lane SLP.
* tree-vect-loop.cc (vect_analyze_loop_2): Track two SLP
modes and adjust accordingly.
(vect_analyze_loop_1): Save the SLP mode when unrolling.

* gcc.dg/vect/vect-outer-slp-1.c: Adjust.
gcc/testsuite/gcc.dg/vect/vect-outer-slp-1.c
gcc/tree-vect-loop.cc
gcc/tree-vect-slp.cc
gcc/tree-vectorizer.h