aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-06-09 14:48:35 +0200
committerRichard Biener <rguenther@suse.de>2021-06-09 16:33:18 +0200
commit374f93da97fb0378453d503f3cfea4d7a923a89c (patch)
tree2899c3123df63912049f2fa094987f262084701c /gcc/tree-vect-loop.c
parentce670e4faafb296d1f1a7828d20f8c8ba4686797 (diff)
downloadgcc-374f93da97fb0378453d503f3cfea4d7a923a89c.zip
gcc-374f93da97fb0378453d503f3cfea4d7a923a89c.tar.gz
gcc-374f93da97fb0378453d503f3cfea4d7a923a89c.tar.bz2
tree-optimization/100981 - fix SLP patterns involving reductions
The following fixes the SLP FMA patterns to preserve reduction info and the reduction vectorization to consider internal function call defs for the reduction stmt. 2021-06-09 Richard Biener <rguenther@suse.de> PR tree-optimization/100981 gcc/ * tree-vect-loop.c (vect_create_epilog_for_reduction): Use gimple_get_lhs to also handle calls. * tree-vect-slp-patterns.c (complex_pattern::build): Transfer reduction info. gcc/testsuite/ * gfortran.dg/vect/pr100981-1.f90: New testcase. libgomp/ * testsuite/libgomp.fortran/pr100981-2.f90: New testcase.
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ba36348..ee79808 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -5247,7 +5247,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
gcc_assert (STMT_VINFO_RELATED_STMT (orig_stmt_info) == stmt_info);
}
- scalar_dest = gimple_assign_lhs (orig_stmt_info->stmt);
+ scalar_dest = gimple_get_lhs (orig_stmt_info->stmt);
scalar_type = TREE_TYPE (scalar_dest);
scalar_results.create (group_size);
new_scalar_dest = vect_create_destination_var (scalar_dest, NULL);