]> git.ipfire.org Git - people/ms/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, 24 Jan 2023 14:41:33 +0000 (15:41 +0100)
commit2461fa40fc24a403dc8149338f44b0e4aef4f173
tree2b3308d138131fda6ee1d255dac090de5997631d
parent9d21cc4edd94f8f2b1a3241fab5cf75649003226
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.c (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.

(cherry picked from commit ee467644c53ee2f7d633a8e1f53603feafab4351)
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.c