]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/tree-vect-slp-patterns.cc
tree-optimization/107647 - avoid FMA from SLP with -ffp-contract=off
authorRichard Biener <rguenther@suse.de>
Thu, 17 Nov 2022 08:43:31 +0000 (09:43 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 18 Nov 2022 07:37:23 +0000 (08:37 +0100)
commitc5df8392c5848c0462558f41cdf6eab31db301cf
tree6b85c07744f373070b696c17c2d72d05314c1db2
parentf0024bfb228f94e60e06dc32a4983e40a9b90be5
tree-optimization/107647 - avoid FMA from SLP with -ffp-contract=off

Only with -ffp-contract=fast we can synthesize FMA operations like
vfmaddsub231ps, so properly guard the transform in SLP pattern
detection.

PR tree-optimization/107647
* tree-vect-slp-patterns.cc (addsub_pattern::recognize): Only
allow FMA generation with -ffp-contract=fast for FP types.
(complex_mul_pattern::matches): Likewise.

* gcc.target/i386/pr107647.c: New testcase.
gcc/testsuite/gcc.target/i386/pr107647.c [new file with mode: 0644]
gcc/tree-vect-slp-patterns.cc