Commit b78500ec by Richard Sandiford Committed by Richard Sandiford

Add missing conversion in vect_create_epilog_for_reduction

The direct_slp_reduc code in vect_create_epilog_for_reduction was
still assuming that all types involved in a reduction are the same
(up to types_compatible_p), whereas we now support differences in
sign.  This was causing an ICE in gcc.dg/vect/pr92324-4.c for SVE.

2019-12-10  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-loop.c (vect_create_epilog_for_reduction): When
	handling direct_slp_reduc, allow the PHI arguments to have
	a different type from the vector elements.

From-SVN: r279164
parent f1c13d6d
2019-12-10 Richard Sandiford <richard.sandiford@arm.com> 2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-loop.c (vect_create_epilog_for_reduction): When
handling direct_slp_reduc, allow the PHI arguments to have
a different type from the vector elements.
2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-stmts.c (vectorizable_condition): Record the loop * tree-vect-stmts.c (vectorizable_condition): Record the loop
masks required for extract-last reductions. masks required for extract-last reductions.
...@@ -5054,6 +5054,8 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info, ...@@ -5054,6 +5054,8 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info,
tree scalar_value tree scalar_value
= PHI_ARG_DEF_FROM_EDGE (orig_phis[i]->stmt, = PHI_ARG_DEF_FROM_EDGE (orig_phis[i]->stmt,
loop_preheader_edge (loop)); loop_preheader_edge (loop));
scalar_value = gimple_convert (&seq, TREE_TYPE (vectype),
scalar_value);
vector_identity = gimple_build_vector_from_val (&seq, vectype, vector_identity = gimple_build_vector_from_val (&seq, vectype,
scalar_value); scalar_value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment