@@ -8749,7 +8749,7 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo,
correctly if ncopies is not one. */
vect_get_vec_defs_for_operand (loop_vinfo, reduc_stmt_info,
ncopies, initial_def,
- &vec_initial_defs);
+ &vec_initial_defs, vectype_out);
}
else if (STMT_VINFO_REDUC_TYPE (reduc_info) == CONST_COND_REDUCTION
|| STMT_VINFO_REDUC_TYPE (reduc_info) == COND_REDUCTION)
@@ -6126,19 +6126,11 @@ vectorizable_shift (vec_info *vinfo,
"use not simple.\n");
return false;
}
- /* If op0 is an external or constant def, infer the vector type
- from the scalar type. */
+ /* If op0 is an external or constant def, use the output vector type. */
if (!vectype)
- vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (op0), slp_node);
+ vectype = vectype_out;
if (vec_stmt)
gcc_assert (vectype);
- if (!vectype)
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "no vectype for scalar type\n");
- return false;
- }
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
nunits_in = TYPE_VECTOR_SUBPARTS (vectype);
@@ -6426,8 +6418,8 @@ vectorizable_shift (vec_info *vinfo,
(a special case for certain kind of vector shifts); otherwise,
operand 1 should be of a vector type (the usual case). */
vect_get_vec_defs (vinfo, stmt_info, slp_node, ncopies,
- op0, &vec_oprnds0,
- vec_oprnd1 ? NULL_TREE : op1, &vec_oprnds1);
+ op0, vectype, &vec_oprnds0,
+ vec_oprnd1 ? NULL_TREE : op1, op1_vectype, &vec_oprnds1);
/* Arguments are ready. Create the new vector stmt. */
FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)
@@ -8537,7 +8529,7 @@ vectorizable_store (vec_info *vinfo,
op = vect_get_store_rhs (next_stmt_info);
if (!costing_p)
vect_get_vec_defs (vinfo, next_stmt_info, slp_node, ncopies, op,
- &vec_oprnds);
+ vectype, &vec_oprnds);
else
update_prologue_cost (&prologue_cost, op);
unsigned int group_el = 0;
@@ -9303,7 +9295,7 @@ vectorizable_store (vec_info *vinfo,
{
vect_get_vec_defs_for_operand (vinfo, next_stmt_info,
ncopies, op,
- gvec_oprnds[i]);
+ gvec_oprnds[i], vectype);
vec_oprnd = (*gvec_oprnds[i])[0];
dr_chain.quick_push (vec_oprnd);
}