= get_masked_reduction_fn (reduc_fn, vectype_in);
vec_loop_masks *masks = &LOOP_VINFO_MASKS (loop_vinfo);
vec_loop_lens *lens = &LOOP_VINFO_LENS (loop_vinfo);
- unsigned nvectors = vect_get_num_copies (loop_vinfo, slp_node,
- vectype_in);
+ unsigned nvectors = vect_get_num_copies (loop_vinfo, slp_node);
if (mask_reduc_fn == IFN_MASK_LEN_FOLD_LEFT_PLUS)
vect_record_loop_len (loop_vinfo, lens, nvectors, vectype_in, 1);
return false;
}
- tree vectype_in = SLP_TREE_VECTYPE (SLP_TREE_CHILDREN (slp_node)[0]);
+ slp_tree node_in = SLP_TREE_CHILDREN (slp_node)[0];
+ tree vectype_in = SLP_TREE_VECTYPE (node_in);
gcc_assert (vectype_in);
/* Compute number of effective vector statements for costing. */
- unsigned int ncopies_for_cost = vect_get_num_copies (loop_vinfo, slp_node,
- vectype_in);
+ unsigned int ncopies_for_cost = vect_get_num_copies (loop_vinfo, node_in);
gcc_assert (ncopies_for_cost >= 1);
if (vect_is_emulated_mixed_dot_prod (slp_node))
{
enum tree_code code = gimple_assign_rhs_code (stmt);
vect_reduction_update_partial_vector_usage (loop_vinfo, reduc_info,
- slp_node, code, type,
+ node_in, code, type,
vectype_in);
}
int reduc_index = SLP_TREE_REDUC_IDX (slp_node);
tree vectype_in = SLP_TREE_VECTYPE (SLP_TREE_CHILDREN (slp_node)[0]);
- vec_num = vect_get_num_copies (loop_vinfo, slp_node, vectype_in);
+ vec_num = vect_get_num_copies (loop_vinfo, SLP_TREE_CHILDREN (slp_node)[0]);
code_helper code = canonicalize_code (op.code, op.type);
internal_fn cond_fn = get_conditional_internal_fn (code, op.type);
gcc_assert (reduc_vectype_in);
unsigned effec_reduc_ncopies
- = vect_get_num_copies (loop_vinfo, slp_node, reduc_vectype_in);
+ = vect_get_num_copies (loop_vinfo, SLP_TREE_CHILDREN (slp_node)[0]);
gcc_assert (effec_ncopies <= effec_reduc_ncopies);
gcc_assert (induction_type > vect_step_op_add);
- ncopies = vect_get_num_copies (loop_vinfo, slp_node, vectype);
+ ncopies = vect_get_num_copies (loop_vinfo, slp_node);
gcc_assert (ncopies >= 1);
/* FORNOW. Only handle nonlinear induction in the same loop. */
}
/* Return the number of vectors in the context of vectorization region VINFO,
- needed for a group of statements, whose size is specified by lanes of NODE,
- if NULL, it is 1. The statements are supposed to be interleaved together
- with no gap, and all operate on vectors of type VECTYPE, if NULL, the
- vectype of NODE is used. */
+ needed for a group of statements and a vector type as specified by NODE. */
inline unsigned int
-vect_get_num_copies (vec_info *vinfo, slp_tree node, tree vectype = NULL)
+vect_get_num_copies (vec_info *vinfo, slp_tree node)
{
poly_uint64 vf;
else
vf = 1;
- if (node)
- {
- vf *= SLP_TREE_LANES (node);
- if (!vectype)
- vectype = SLP_TREE_VECTYPE (node);
- }
+ vf *= SLP_TREE_LANES (node);
+ tree vectype = SLP_TREE_VECTYPE (node);
return vect_get_num_vectors (vf, vectype);
}
-/* Return the number of copies needed for loop vectorization when
- a statement operates on vectors of type VECTYPE. This is the
- vectorization factor divided by the number of elements in
- VECTYPE and is always known at compile time. */
-
-inline unsigned int
-vect_get_num_copies (loop_vec_info loop_vinfo, tree vectype)
-{
- return vect_get_num_copies (loop_vinfo, NULL, vectype);
-}
-
/* Update maximum unit count *MAX_NUNITS so that it accounts for
NUNITS. *MAX_NUNITS can be 1 if we haven't yet recorded anything. */