]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/114027 - conditional reduction chain
authorRichard Biener <rguenther@suse.de>
Thu, 22 Feb 2024 09:50:12 +0000 (10:50 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 21 Jun 2024 09:20:51 +0000 (11:20 +0200)
commitb6a029286d5034d63063ae78f406ba677c37d015
treeedead8449a3676c4a35df4359ed29e0ed934ddfc
parenta43c9bea7bd80af33ae116e7197f814ad911857e
tree-optimization/114027 - conditional reduction chain

When we classify a conditional reduction chain as CONST_COND_REDUCTION
we fail to verify all involved conditionals have the same constant.
That's a quite unlikely situation so the following simply disables
such classification when there's more than one reduction statement.

PR tree-optimization/114027
* tree-vect-loop.c (vecctorizable_reduction): Use optimized
condition reduction classification only for single-element
chains.

* gcc.dg/vect/pr114027.c: New testcase.

(cherry picked from commit 549f251f055e3a0b0084189a3012c4f15d635e75)
gcc/testsuite/gcc.dg/vect/pr114027.c [new file with mode: 0644]
gcc/tree-vect-loop.c