Consider building nodes from scalars in vect_slp_analyze_node_operations
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 14 Nov 2019 15:33:49 +0000 (15:33 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 14 Nov 2019 15:33:49 +0000 (15:33 +0000)
commit60838d634634a70d65a126166c944b159ac7649c
treeb64a9b2ac2d31399b5c1c0dee684a6cc4ad1818b
parent9c437a108a14b9bdc44659c131b0da944e5ffeab
Consider building nodes from scalars in vect_slp_analyze_node_operations

If the statements in an SLP node aren't similar enough to be vectorised,
or aren't something the vectoriser has code to handle, the BB vectoriser
tries building the vector from scalars instead.  This patch does the
same thing if we're able to build a viable-looking tree but fail later
during the analysis phase, e.g. because the target doesn't support a
particular vector operation.

This is needed to avoid regressions with a later patch.

2019-11-14  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-slp.c (vect_contains_pattern_stmt_p): New function.
(vect_slp_convert_to_external): Likewise.
(vect_slp_analyze_node_operations): If analysis fails, try building
the node from scalars instead.

gcc/testsuite/
* gcc.dg/vect/bb-slp-div-2.c: New test.

From-SVN: r278246
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/bb-slp-div-2.c [new file with mode: 0644]
gcc/tree-vect-slp.c