tree-optimization/98854 - avoid some PHI BB vectorization
authorRichard Biener <rguenther@suse.de>
Wed, 27 Jan 2021 14:20:58 +0000 (15:20 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 27 Jan 2021 16:33:34 +0000 (17:33 +0100)
commitc91db798ec65b3e55f2380ca1530ecb71544f1bb
tree04dda92d83caa69419cbc1b51205de5550c0f7b0
parent3fd10728cb1aacf593a7a006ad40e874f791d655
tree-optimization/98854 - avoid some PHI BB vectorization

This avoids cases of PHI node vectorization that just causes us
to insert vector CTORs inside loops for values only required
outside of the loop.

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

PR tree-optimization/98854
* tree-vect-slp.c (vect_build_slp_tree_2): Also build
PHIs from scalars when the number of CTORs matches the
number of children.

* gcc.dg/vect/bb-slp-pr98854.c: New testcase.
gcc/testsuite/gcc.dg/vect/bb-slp-pr98854.c [new file with mode: 0644]
gcc/tree-vect-slp.c