Use canonicalize_math_after_vectorization_p for FMA folds
commitbdcde03ae8e10c28c56af71d1bdcbff35f8d1896
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 12:34:18 +0000 (24 12:34 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 12:34:18 +0000 (24 12:34 +0000)
treea370c4868f5adf7c1f2a37c67c0b608933c93782
parent1c1d435dd45ef6b4543a70ae14d98734ff49e521
Use canonicalize_math_after_vectorization_p for FMA folds

The folds in r260348 kicked in before vectorisation, which hurts
for two reasons:

(1) the current suboptimal handling of nothrow meant that we could
    drop the flag early and so prevent if-conversion

(2) some architectures provide more scalar forms than vector forms
    (true for Advanced SIMD)

(1) is a bug in itself that needs to be fixed eventually, but delaying
the folds is still needed for (2).

2018-05-24  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* match.pd: Delay FMA folds until after vectorization.

gcc/testsuite/
* gcc.dg/vect/vect-fma-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260639 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-fma-1.c [new file with mode: 0644]