tree-optimization/114027 - conditional reduction chain
commit549f251f055e3a0b0084189a3012c4f15d635e75
authorRichard Biener <rguenther@suse.de>
Thu, 22 Feb 2024 09:50:12 +0000 (22 10:50 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 22 Feb 2024 12:13:48 +0000 (22 13:13 +0100)
treee920c24546d657aa006b7cb03c5ba1dc9f96cabd
parenta0782531b8270f0fdb3f3e09b4ce544d5d1eef14
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.cc (vecctorizable_reduction): Use optimized
condition reduction classification only for single-element
chains.

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