]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/122406 - incomplete handling of reduction chain with conversion
authorRichard Biener <rguenther@suse.de>
Fri, 24 Oct 2025 07:07:56 +0000 (09:07 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 24 Oct 2025 09:50:54 +0000 (11:50 +0200)
commite98160489e5c09de0903bcc6d0d16f0be70d06c0
tree7f01c9441b7d6b50026034310ea6d7458d2b2e1e
parent6b90d56d0c352a151efabe06f81d26faeeb9496f
tree-optimization/122406 - incomplete handling of reduction chain with conversion

The following fixes the mixup between reduction operation and conversion
wrapping a reduction chain.  This also exposes a missed optimization
but I'm going to fix that in a followup.

PR tree-optimization/122406
* tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Create
the SLP nodes for the conversions around the reduction
operation if required.

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