tree-optimization/97334 - improve BB SLP discovery
authorRichard Biener <rguenther@suse.de>
Fri, 9 Oct 2020 10:24:46 +0000 (12:24 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 9 Oct 2020 11:15:10 +0000 (13:15 +0200)
commit16760e5bf7028dfa36b39af305d05cdf2c15b3a9
treee7fbe7b617e7172110d047bbc980e00d916c93ab
parentafcbeb35e0b9fb0251d04362a1bd4031520ff7f8
tree-optimization/97334 - improve BB SLP discovery

We're running into a multiplication with one unvectorizable
operand we expect to build from scalars but SLP discovery
fatally fails the build of both since one stmt is commutated:

  _60 = _58 * _59;
  _63 = _59 * _62;
  _66 = _59 * _65;
...

where _59 is the "bad" operand.  The following patch makes the
case work where the first stmt has a good operand by not fatally
failing the SLP build for the operand but communicating upwards
how to commutate.

2020-10-09  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97334
* tree-vect-slp.c (vect_build_slp_tree_1): Do not fatally
fail lanes other than zero when BB vectorizing.

* gcc.dg/vect/bb-slp-pr65935.c: Amend.
gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c
gcc/tree-vect-slp.c