Add missing target check for fully-masked fold-left reductions
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Dec 2019 16:54:54 +0000 (16:54 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 27 Dec 2019 16:54:54 +0000 (16:54 +0000)
commitcd8aa0d1a5e9547cf3d47ab3bd53f63ec3920b36
tree8c26dff98ee27b49a1359fffaca1f64545c8327f
parent049e64f8f19552ec75b6796223a8961038c24fcd
Add missing target check for fully-masked fold-left reductions

The fold-left reduction code has a (rarely-used) fallback that handles
cases in which the loop is fully-masked and the target has no native
support for the reduction.  The fallback includea a VEC_COND_EXPR
between the reduction vector and a safe value, so we should check
whether that VEC_COND_EXPR is supported.

2019-12-27  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-loop.c (vectorizable_reduction): Check whether the
target supports the required VEC_COND_EXPR operation before
allowing the fallback handling of masked fold-left reductions.

gcc/testsuite/
* gcc.target/aarch64/sve/mixed_size_10.c: New test.

From-SVN: r279742
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/mixed_size_10.c [new file with mode: 0644]
gcc/tree-vect-loop.c