Disable some patterns for fold-left reductions (PR 83965)
commit82f601378350c065a7cc8e04b8b0799824e3ca59
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Jan 2018 10:42:10 +0000 (23 10:42 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Jan 2018 10:42:10 +0000 (23 10:42 +0000)
tree5fceb56c5088a09714affe78100c8e617f08cd51
parentf12452a90b3763d8e4986e1d13a21e53c651849b
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256976 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr83965.c [new file with mode: 0644]
gcc/tree-vect-patterns.c