2019-11-29 Richard Sandiford <richard.sandiford@arm.com>
+ * tree-vectorizer.h (get_mask_type_for_scalar_type): Replace
+ the slp_tree parameter with a group size parameter.
+ (vect_get_mask_type_for_stmt): Likewise.
+ * tree-vect-stmts.c (get_mask_type_for_scalar_type): Likewise.
+ (vect_get_mask_type_for_stmt): Likewise.
+ * tree-vect-slp.c (vect_slp_analyze_node_operations_1): Update
+ call accordingly.
+
+2019-11-29 Richard Sandiford <richard.sandiford@arm.com>
+
* tree-vect-stmts.c (vectorizable_operation): Punt early
on codes that are handled elsewhere.
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
if (bb_vinfo && STMT_VINFO_VECTYPE (stmt_info) == boolean_type_node)
{
- tree vectype = vect_get_mask_type_for_stmt (stmt_info, node);
+ unsigned int group_size = SLP_TREE_SCALAR_STMTS (node).length ();
+ tree vectype = vect_get_mask_type_for_stmt (stmt_info, group_size);
if (!vectype)
/* vect_get_mask_type_for_stmt has already explained the
failure. */
Returns the mask type corresponding to a result of comparison
of vectors of specified SCALAR_TYPE as supported by target.
- NODE, if nonnull, is the SLP tree node that will use the returned
- vector type. */
+ If GROUP_SIZE is nonzero and we're performing BB vectorization,
+ make sure that the number of elements in the vector is no bigger
+ than GROUP_SIZE. */
tree
get_mask_type_for_scalar_type (vec_info *vinfo, tree scalar_type,
- slp_tree node)
+ unsigned int group_size)
{
- tree vectype = get_vectype_for_scalar_type (vinfo, scalar_type, node);
+ tree vectype = get_vectype_for_scalar_type (vinfo, scalar_type, group_size);
if (!vectype)
return NULL;
/* Try to determine the correct vector type for STMT_INFO, which is a
statement that produces a scalar boolean result. Return the vector
- type on success, otherwise return NULL_TREE. NODE, if nonnull,
- is the SLP tree node that will use the returned vector type. */
+ type on success, otherwise return NULL_TREE. If GROUP_SIZE is nonzero
+ and we're performing BB vectorization, make sure that the number of
+ elements in the vector is no bigger than GROUP_SIZE. */
opt_tree
-vect_get_mask_type_for_stmt (stmt_vec_info stmt_info, slp_tree node)
+vect_get_mask_type_for_stmt (stmt_vec_info stmt_info, unsigned int group_size)
{
vec_info *vinfo = stmt_info->vinfo;
gimple *stmt = stmt_info->stmt;
&& !VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt))))
{
scalar_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
- mask_type = get_mask_type_for_scalar_type (vinfo, scalar_type, node);
+ mask_type = get_mask_type_for_scalar_type (vinfo, scalar_type,
+ group_size);
if (!mask_type)
return opt_tree::failure_at (stmt,
poly_uint64 = 0);
extern tree get_vectype_for_scalar_type (vec_info *, tree, unsigned int = 0);
extern tree get_vectype_for_scalar_type (vec_info *, tree, slp_tree);
-extern tree get_mask_type_for_scalar_type (vec_info *, tree, slp_tree = 0);
+extern tree get_mask_type_for_scalar_type (vec_info *, tree, unsigned int = 0);
extern tree get_same_sized_vectype (tree, tree);
extern bool vect_chooses_same_modes_p (vec_info *, machine_mode);
extern bool vect_get_loop_mask_type (loop_vec_info);
extern tree vect_gen_while_not (gimple_seq *, tree, tree, tree);
extern opt_result vect_get_vector_types_for_stmt (stmt_vec_info, tree *,
tree *, unsigned int = 0);
-extern opt_tree vect_get_mask_type_for_stmt (stmt_vec_info, slp_tree = 0);
+extern opt_tree vect_get_mask_type_for_stmt (stmt_vec_info, unsigned int = 0);
/* In tree-vect-data-refs.c. */
extern bool vect_can_force_dr_alignment_p (const_tree, poly_uint64);