stmt_vector_for_cost *cost_vec)
{
tree vectype_in = NULL_TREE;
+ tree vectype_op[3] = { NULL_TREE, NULL_TREE, NULL_TREE };
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum vect_def_type cond_reduc_dt = vect_unknown_def_type;
stmt_vec_info cond_stmt_vinfo = NULL;
bool nested_cycle = false;
bool double_reduc = false;
int vec_num;
- tree tem;
tree cr_index_scalar_type = NULL_TREE, cr_index_vector_type = NULL_TREE;
tree cond_reduc_val = NULL_TREE;
enum vect_def_type dt;
if (!vect_is_simple_use (loop_vinfo, stmt_info, slp_for_stmt_info,
i + opno_adjust, &op.ops[i], &slp_op[i], &dt,
- &tem, &def_stmt_info))
+ &vectype_op[i], &def_stmt_info))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
if (VECTORIZABLE_CYCLE_DEF (dt))
return false;
+ if (!vectype_op[i])
+ vectype_op[i]
+ = get_vectype_for_scalar_type (loop_vinfo,
+ TREE_TYPE (op.ops[i]), slp_op[i]);
+
/* To properly compute ncopies we are interested in the widest
non-reduction input type in case we're looking at a widening
accumulation that we later handle in vect_transform_reduction. */
if (lane_reduc_code_p
- && tem
+ && vectype_op[i]
&& (!vectype_in
|| (GET_MODE_SIZE (SCALAR_TYPE_MODE (TREE_TYPE (vectype_in)))
- < GET_MODE_SIZE (SCALAR_TYPE_MODE (TREE_TYPE (tem))))))
- vectype_in = tem;
+ < GET_MODE_SIZE (SCALAR_TYPE_MODE (TREE_TYPE (vectype_op[i]))))))
+ vectype_in = vectype_op[i];
if (op.code == COND_EXPR)
{
&& !lane_reduc_code_p
&& reduction_type != FOLD_LEFT_REDUCTION))
for (i = 0; i < (int) op.num_ops; i++)
- if (!vect_maybe_update_slp_op_vectype (slp_op[i], vectype_in))
+ if (!vect_maybe_update_slp_op_vectype (slp_op[i], vectype_op[i]))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,