tree-optimization/100981 - fix SLP patterns involving reductions
authorRichard Biener <rguenther@suse.de>
Wed, 9 Jun 2021 12:48:35 +0000 (14:48 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 9 Jun 2021 14:33:18 +0000 (16:33 +0200)
commit374f93da97fb0378453d503f3cfea4d7a923a89c
tree2899c3123df63912049f2fa094987f262084701c
parentce670e4faafb296d1f1a7828d20f8c8ba4686797
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.
gcc/testsuite/gfortran.dg/vect/pr100981-1.f90 [new file with mode: 0644]
gcc/tree-vect-loop.c
gcc/tree-vect-slp-patterns.c
libgomp/testsuite/libgomp.fortran/pr100981-2.f90 [new file with mode: 0644]