tree-optimization/98291 - allow SLP more vectorization of reductions
authorRichard Biener <rguenther@suse.de>
Mon, 4 Jan 2021 08:53:11 +0000 (09:53 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 4 Jan 2021 09:47:43 +0000 (10:47 +0100)
commit8837f82e4bab1b5405cf034eab9b3e83afc563ad
treeaaf2a349e092221769a6a891d3d398f3f1dd73a5
parentad64e807ffca93e927b68f1aa0cea54dacbe9afd
tree-optimization/98291 - allow SLP more vectorization of reductions

When the VF is one a SLP reduction is in-order and thus we can
vectorize even when the reduction op is not associative.

2021-01-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98291
* tree-vect-loop.c (vectorizable_reduction): Bypass
associativity check for SLP reductions with VF 1.

* gcc.dg/vect/slp-reduc-11.c: New testcase.
* gcc.dg/vect/vect-reduc-in-order-4.c: Adjust.
gcc/testsuite/gcc.dg/vect/slp-reduc-11.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-reduc-in-order-4.c
gcc/tree-vect-loop.c