Disable some patterns for fold-left reductions (PR 83965)
authorRichard Sandiford <richard.sandiford@linaro.org>
Tue, 23 Jan 2018 10:42:10 +0000 (10:42 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 23 Jan 2018 10:42:10 +0000 (10:42 +0000)
commit97e52238b292ca744368f66980533c578838e94c
tree5fceb56c5088a09714affe78100c8e617f08cd51
parent9f4b0885e77f836169c290e93faa87b58ab34276
Disable some patterns for fold-left reductions (PR 83965)

In this PR we recognised a PLUS_EXPR as a fold-left reduction,
then applied pattern matching to convert it to a WIDEN_SUM_EXPR.
We need to keep the original code in this case since we implement
the reduction using scalar rather than vector operations.

2018-01-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83965
* tree-vect-patterns.c (vect_reassociating_reduction_p): New function.
(vect_recog_dot_prod_pattern, vect_recog_sad_pattern): Use it
instead of checking only for a reduction.
(vect_recog_widen_sum_pattern): Likewise.

gcc/testsuite/
PR tree-optimization/83965
* gcc.dg/vect/pr83965.c: New test.

From-SVN: r256976
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr83965.c [new file with mode: 0644]
gcc/tree-vect-patterns.c