Adjust BB vectorization SLP build heuristics
This changes SLP def gathering to not fail due to mismatched
def type but instead demote the def to external. This allows the
new testcase to be vectorized in full (with GCC 10 it is not
vectorized at all and with current trunk we vectorize only the
store). This is important since with BB vectorization being
applied to bigger pieces of code the chance that we mix
internal and external defs for an operand that should end up
treated as external (built from scalars) increases.
2020-10-16 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_get_and_check_slp_defs): For BB
vectorization swap operands only if it helps, demote mismatches to
external.
* gcc.dg/vect/bb-slp-53.c: New testcase.