Skip to content

Commit

Permalink
tree-optimization/115493 - fix wrong code with SLP induction cond red…
Browse files Browse the repository at this point in the history
…uction

The following fixes a bad final value being used when doing single-lane
SLP integer induction cond reduction vectorization.

	PR tree-optimization/115493
	* tree-vect-loop.cc (vect_create_epilog_for_reduction): Use
	the first scalar result.
  • Loading branch information
rguenth committed Jun 18, 2024
1 parent 4b75ed3 commit 19258ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gcc/tree-vect-loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6843,8 +6843,8 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
with the original initial value, unless induc_val is
the same as initial_def already. */
tree zcompare = make_ssa_name (boolean_type_node);
epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR, new_temp,
induc_val);
epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR,
scalar_results[0], induc_val);
gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
tree initial_def = reduc_info->reduc_initial_values[0];
tree tmp = make_ssa_name (new_scalar_dest);
Expand Down

0 comments on commit 19258ca

Please sign in to comment.