]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/99412 - reassoc and reduction chains
authorRichard Biener <rguenther@suse.de>
Thu, 12 Jan 2023 10:18:22 +0000 (11:18 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 12 Jan 2023 13:30:21 +0000 (14:30 +0100)
commitb073f2b098ba7819450d6c14a0fb96cb1c09f242
tree4e4737fd89497bae3814686055011758a3a55734
parent117be79bd84ed21b47588d0cd86d72d5d1757cae
tree-optimization/99412 - reassoc and reduction chains

With -ffast-math we end up associating reduction chains and break
them - this is because of old code that tries to rectify reductions
into a shape likened by the vectorizer.  Nowadays the rank compute
produces correct association for reduction chains and the vectorizer
has robust support to fall back to a regular reductions (via
reduction path) when it turns out to be not a proper reduction chain.

So this patch removes the special code in reassoc which makes
the TSVC s352 vectorized with -Ofast (it is already without
-ffast-math).

PR tree-optimization/99412
* tree-ssa-reassoc.cc (is_phi_for_stmt): Remove.
(swap_ops_for_binary_stmt): Remove reduction handling.
(rewrite_expr_tree_parallel): Adjust.
(reassociate_bb): Likewise.
* tree-parloops.cc (build_new_reduction): Handle MINUS_EXPR.

* gcc.dg/vect/pr99412.c: New testcase.
* gcc.dg/tree-ssa/reassoc-47.c: Adjust comment.
* gcc.dg/tree-ssa/reassoc-48.c: Remove.
gcc/testsuite/gcc.dg/tree-ssa/reassoc-47.c
gcc/testsuite/gcc.dg/tree-ssa/reassoc-48.c [deleted file]
gcc/testsuite/gcc.dg/vect/pr99412.c [new file with mode: 0644]
gcc/tree-parloops.cc
gcc/tree-ssa-reassoc.cc
This page took 0.07843 seconds and 6 git commands to generate.