vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
vec<stmt_vec_info> stmts, unsigned int group_size,
poly_uint64 *max_nunits, bool *matches,
- bool *two_operators)
+ bool *two_operators, tree *node_vectype)
{
unsigned int i;
stmt_vec_info first_stmt_info = stmts[0];
/* Check the operation. */
if (i == 0)
{
+ *node_vectype = vectype;
first_stmt_code = rhs_code;
/* Shift arguments should be equal in all the packed stmts for a
return NULL;
(*tree_size)++;
node = vect_create_new_slp_node (stmts, 0);
+ SLP_TREE_VECTYPE (node) = vectype;
return node;
}
bool two_operators = false;
unsigned char *swap = XALLOCAVEC (unsigned char, group_size);
+ tree vectype = NULL_TREE;
if (!vect_build_slp_tree_1 (vinfo, swap, stmts, group_size,
- &this_max_nunits, matches, &two_operators))
+ &this_max_nunits, matches, &two_operators,
+ &vectype))
return NULL;
/* If the SLP node is a load, terminate the recursion unless masked. */
*max_nunits = this_max_nunits;
(*tree_size)++;
node = vect_create_new_slp_node (stmts, 0);
+ SLP_TREE_VECTYPE (node) = vectype;
/* And compute the load permutation. Whether it is actually
a permutation depends on the unrolling factor which is
decided later. */
node = vect_create_new_slp_node (stmts, nops);
SLP_TREE_TWO_OPERATORS (node) = two_operators;
+ SLP_TREE_VECTYPE (node) = vectype;
SLP_TREE_CHILDREN (node).splice (children);
return node;
}
for (unsigned i = 0; i < group_size; ++i)
scalar_stmts.quick_push (next_info);
slp_tree conv = vect_create_new_slp_node (scalar_stmts, 1);
+ SLP_TREE_VECTYPE (conv) = STMT_VINFO_VECTYPE (next_info);
SLP_TREE_CHILDREN (conv).quick_push (node);
SLP_INSTANCE_TREE (new_instance) = conv;
/* We also have to fake this conversion stmt as SLP reduction
else
vf = 1;
unsigned int group_size = SLP_TREE_LANES (node);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+ tree vectype = SLP_TREE_VECTYPE (node);
SLP_TREE_NUMBER_OF_VEC_STMTS (node)
= vect_get_num_vectors (vf * group_size, vectype);
}
stmt_vec_info stmt_info = SLP_TREE_REPRESENTATIVE (node);
/* VECTYPE is the type of the destination. */
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+ tree vectype = SLP_TREE_VECTYPE (node);
poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
unsigned group_size = SLP_TREE_SCALAR_STMTS (node).length ();
{
slp_tree child = SLP_TREE_CHILDREN (slp_node)[operand];
*slp_def = child;
+ *vectype = SLP_TREE_VECTYPE (child);
if (SLP_TREE_DEF_TYPE (child) == vect_internal_def)
- *op = gimple_get_lhs (SLP_TREE_REPRESENTATIVE (child)->stmt);
+ {
+ *op = gimple_get_lhs (SLP_TREE_REPRESENTATIVE (child)->stmt);
+ return vect_is_simple_use (*op, vinfo, dt, def_stmt_info_out);
+ }
else
{
if (def_stmt_info_out)
*def_stmt_info_out = NULL;
*op = SLP_TREE_SCALAR_OPS (child)[0];
*dt = SLP_TREE_DEF_TYPE (child);
- *vectype = SLP_TREE_VECTYPE (child);
return true;
}
}
}
else
gcc_unreachable ();
+ return vect_is_simple_use (*op, vinfo, dt, vectype, def_stmt_info_out);
}
-
- /* ??? We might want to update *vectype from *slp_def here though
- when sharing nodes this would prevent unsharing in the caller. */
- return vect_is_simple_use (*op, vinfo, dt, vectype, def_stmt_info_out);
}
/* If OP is not NULL and is external or constant update its vector