]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/115538 - possible wrong-code with SLP conversion
authorRichard Biener <rguenther@suse.de>
Fri, 7 Feb 2025 07:46:31 +0000 (08:46 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 7 Feb 2025 12:39:58 +0000 (13:39 +0100)
commit4931a637479aba35e35c50a86f58ecd6262bc487
treeda27a0927dcfccf0714efcdf50180df2163d8e0c
parent6aa3329b3430c6362ddf51e403d147e0b10d7401
tree-optimization/115538 - possible wrong-code with SLP conversion

The following fixes a latent issue where we use ranges to verify
correctness of a vector conversion optimization.  We rely on ranges
from 'op0' which for SLP is extracted from the representative stmt
which does not necessarily correspond to any actual scalar operation.
We also do not verify the range of all scalar lanes in the SLP
operand match.  The following rectifies this, restricting the support
to single-lane SLP nodes at this point - on branches we'd simply
not perform this optimization with SLP.

PR tree-optimization/115538
* tree-vectorizer.h (vect_get_slp_scalar_def): Declare.
* tree-vect-slp.cc (vect_get_slp_scalar_def): New helper.
* tree-vect-generic.cc (expand_vector_conversion): Adjust.
* tree-vect-stmts.cc (vectorizable_conversion): For SLP
correctly look at ranges of the scalar defs of the SLP operand.
(supportable_indirect_convert_operation): Likewise.
gcc/tree-vect-generic.cc
gcc/tree-vect-slp.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h