gcc_assert (induction_type > vect_step_op_add);
- if (slp_node)
- ncopies = 1;
- else
- ncopies = vect_get_num_copies (loop_vinfo, vectype);
+ ncopies = vect_get_num_copies (loop_vinfo, slp_node, vectype);
gcc_assert (ncopies >= 1);
/* FORNOW. Only handle nonlinear induction in the same loop. */
iv_loop = loop;
gcc_assert (iv_loop == (gimple_bb (phi))->loop_father);
- /* TODO: Support slp for nonlinear iv. There should be separate vector iv
- update for each iv and a permutation to generate wanted vector iv. */
- if (slp_node)
+ /* TODO: Support multi-lane SLP for nonlinear iv. There should be separate
+ vector iv update for each iv and a permutation to generate wanted
+ vector iv. */
+ if (slp_node && SLP_TREE_LANES (slp_node) > 1)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
add_phi_arg (induction_phi, vec_def, loop_latch_edge (iv_loop),
UNKNOWN_LOCATION);
- STMT_VINFO_VEC_STMTS (stmt_info).safe_push (induction_phi);
- *vec_stmt = induction_phi;
+ if (slp_node)
+ slp_node->push_vec_def (induction_phi);
+ else
+ {
+ STMT_VINFO_VEC_STMTS (stmt_info).safe_push (induction_phi);
+ *vec_stmt = induction_phi;
+ }
/* In case that vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
induction_type);
gsi_insert_seq_before (&si, stmts, GSI_SAME_STMT);
new_stmt = SSA_NAME_DEF_STMT (vec_def);
- STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
+ if (slp_node)
+ slp_node->push_vec_def (new_stmt);
+ else
+ STMT_VINFO_VEC_STMTS (stmt_info).safe_push (new_stmt);
}
}