Use canonicalize_math_after_vectorization_p for FMA folds
authorRichard Sandiford <richard.sandiford@linaro.org>
Thu, 24 May 2018 12:34:18 +0000 (12:34 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 24 May 2018 12:34:18 +0000 (12:34 +0000)
commitc453ccc2335bf4267a154c9385eb50a8c45235a1
treea370c4868f5adf7c1f2a37c67c0b608933c93782
parent0c08e1f85d96dd50de4289f05beb87b83b6d1d83
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.

From-SVN: r260639
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-fma-1.c [new file with mode: 0644]