]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/107212 - SLP reduction of reduction paths
authorRichard Biener <rguenther@suse.de>
Tue, 11 Oct 2022 09:34:55 +0000 (11:34 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 11 Oct 2022 11:15:34 +0000 (13:15 +0200)
commitee467644c53ee2f7d633a8e1f53603feafab4351
treec74d7d3d017dd4e1e182e5dfd43e91bb490ef131
parentbd9a05594d227cde79a67dc715bd9d82e9c464e9
tree-optimization/107212 - SLP reduction of reduction paths

The following fixes an issue with how we handle epilogue generation
for SLP reductions of reduction paths where the actual live lanes
are not "canonical".  We need to make sure to identify all live
lanes as reductions and thus have to iterate over all participating
SLP lanes when walking the reduction SSA use-def chain.  Also the
previous attempt likely to mitigate such issue in
vectorizable_live_operation is misguided and has to be removed.

PR tree-optimization/107212
* tree-vect-loop.cc (vectorizable_reduction): Make sure to
set STMT_VINFO_REDUC_DEF for all live lanes in a SLP
reduction.
(vectorizable_live_operation): Do not pun to the SLP
node representative for reduction epilogue generation.

* gcc.dg/vect/pr107212-1.c: New testcase.
* gcc.dg/vect/pr107212-2.c: Likewise.
gcc/testsuite/gcc.dg/vect/pr107212-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr107212-2.c [new file with mode: 0644]
gcc/tree-vect-loop.cc