aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-11-13 08:04:31 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-11-13 08:04:31 +0000
commitefc40c1f85bbeb2bf7e6f5cc5c3cfc6ceb59af07 (patch)
tree288df16f30cb06ffe726e23eaac6d1410c973a8b /gcc
parente08f64f0f47a5c0b8899d04efb2d5659b8ededd0 (diff)
downloadgcc-efc40c1f85bbeb2bf7e6f5cc5c3cfc6ceb59af07.zip
gcc-efc40c1f85bbeb2bf7e6f5cc5c3cfc6ceb59af07.tar.gz
gcc-efc40c1f85bbeb2bf7e6f5cc5c3cfc6ceb59af07.tar.bz2
re PR target/92473 (test pr92324-2.c fails on arm and aarch64)
2019-11-13 Richard Biener <rguenther@suse.de> PR tree-optimization/92473 * tree-vect-loop.c (vect_create_epilog_for_reduction): Perform direct optab reduction in the correct type. From-SVN: r278113
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vect-loop.c30
2 files changed, 12 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e8ebbec..968c273 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/92473
+ * tree-vect-loop.c (vect_create_epilog_for_reduction): Perform
+ direct optab reduction in the correct type.
+
2019-11-12 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (rs6000_set_fpscr_drn): Use ULL on big
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 29770db..d9f4134 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4739,31 +4739,13 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info,
dump_printf_loc (MSG_NOTE, vect_location,
"Reduce using direct vector reduction.\n");
+ gimple_seq stmts = NULL;
+ new_phi_result = gimple_convert (&stmts, vectype, new_phi_result);
vec_elem_type = TREE_TYPE (TREE_TYPE (new_phi_result));
- if (!useless_type_conversion_p (scalar_type, vec_elem_type))
- {
- tree tmp_dest
- = vect_create_destination_var (scalar_dest, vec_elem_type);
- epilog_stmt = gimple_build_call_internal (reduc_fn, 1,
- new_phi_result);
- gimple_set_lhs (epilog_stmt, tmp_dest);
- new_temp = make_ssa_name (tmp_dest, epilog_stmt);
- gimple_set_lhs (epilog_stmt, new_temp);
- gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
-
- epilog_stmt = gimple_build_assign (new_scalar_dest, NOP_EXPR,
- new_temp);
- }
- else
- {
- epilog_stmt = gimple_build_call_internal (reduc_fn, 1,
- new_phi_result);
- gimple_set_lhs (epilog_stmt, new_scalar_dest);
- }
-
- new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- gimple_set_lhs (epilog_stmt, new_temp);
- gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
+ new_temp = gimple_build (&stmts, as_combined_fn (reduc_fn),
+ vec_elem_type, new_phi_result);
+ new_temp = gimple_convert (&stmts, scalar_type, new_temp);
+ gsi_insert_seq_before (&exit_gsi, stmts, GSI_SAME_STMT);
if ((STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
&& induc_val)