aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vect-loop.cc')
-rw-r--r--gcc/tree-vect-loop.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index ab7dade..f204b72 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -5697,14 +5697,13 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
old_idx_val);
gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
+ tree cond = make_ssa_name (boolean_type_node);
+ epilog_stmt = gimple_build_assign (cond, GT_EXPR,
+ idx_val, old_idx_val);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
tree new_val = make_ssa_name (data_eltype);
- epilog_stmt = gimple_build_assign (new_val,
- COND_EXPR,
- build2 (GT_EXPR,
- boolean_type_node,
- idx_val,
- old_idx_val),
- val, old_val);
+ epilog_stmt = gimple_build_assign (new_val, COND_EXPR,
+ cond, val, old_val);
gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
idx_val = new_idx_val;
val = new_val;
@@ -5747,10 +5746,11 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
values. Check the result and if it is induc_val then replace
with the original initial value, unless induc_val is
the same as initial_def already. */
- tree zcompare = build2 (EQ_EXPR, boolean_type_node, new_temp,
- induc_val);
+ tree zcompare = make_ssa_name (boolean_type_node);
+ epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR,
+ new_temp, induc_val);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
tree initial_def = reduc_info->reduc_initial_values[0];
-
tmp = make_ssa_name (new_scalar_dest);
epilog_stmt = gimple_build_assign (tmp, COND_EXPR, zcompare,
initial_def, new_temp);
@@ -6039,10 +6039,11 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
values. Check the result and if it is induc_val then replace
with the original initial value, unless induc_val is
the same as initial_def already. */
- tree zcompare = build2 (EQ_EXPR, boolean_type_node, new_temp,
- induc_val);
+ tree zcompare = make_ssa_name (boolean_type_node);
+ epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR, new_temp,
+ 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);
epilog_stmt = gimple_build_assign (tmp, COND_EXPR, zcompare,
initial_def, new_temp);