vect: Fix COND_EXPRs involving variant booleans [PR94727]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 28 Apr 2020 07:04:29 +0000 (08:04 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 28 Apr 2020 07:04:29 +0000 (08:04 +0100)
commite62a820d686d1fa97a9eefdc65ca07d8f96ac9f4
tree1af5cafdf0ce540b2ae36aca7145bd9901b64b65
parentf5edc76acac7bbadd8d1b00c4cc5994b2a088542
vect: Fix COND_EXPRs involving variant booleans [PR94727]

The previous patch for this PR handled separate comparisons.
However, as arm targets show, the same fix is needed when
handling comparisons embedded in a VEC_COND_EXPR.

Here too, the problem is that vect_get_constant_vectors will
calculate its own vector type, using truth_type_for on the
STMT_VINFO_VECTYPE, and the vectoriable_* routines need to be
consistent with that.

2020-04-28  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/94727
* tree-vect-stmts.c (vect_is_simple_cond): If both comparison
operands are invariant booleans, use the mask type associated with the
STMT_VINFO_VECTYPE.  Use !slp_node instead of !vectype to exclude SLP.
(vectorizable_condition): Pass vectype unconditionally to
vect_is_simple_cond.
gcc/ChangeLog
gcc/tree-vect-stmts.c