vect: Pattern-matched calls in reduction chains
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 22 Jan 2020 18:21:05 +0000 (18:21 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 28 Jan 2020 11:06:43 +0000 (11:06 +0000)
commit1e26ff7391c54c6d30760aea427b6bc2bdb46124
tree426722890ce5b7cdb4f2e2f754bb53ed4e353a90
parent627d59b6b3062de921fbdd80b2b48de18f599d03
vect: Pattern-matched calls in reduction chains

gcc.dg/pr56350.c started ICEing for SVE in GCC 10 because we
pattern-matched a division reduction:

      a /= 8;

into a signed shift with division semantics:

      ... = IFN_SDIV_POW2 (..., 3);

whereas the reduction code expected it still to be a gassign.

One fix would be to check for a reduction in the pattern matcher
(but current patterns don't generally do that).  Another would be
to fail gracefully for reductions involving calls.  Since we can't
vectorise the reduction either way, and probably have a better shot
with the shift form, this patch goes for the "fail gracefully" approach.

2020-01-28  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-loop.c (vectorizable_reduction): Fail gracefully
for reduction chains that (now) include a call.
gcc/ChangeLog
gcc/tree-vect-loop.c