Fix SLP vectorization of stores from boolean vectors
authorRichard Biener <rguenther@suse.de>
Thu, 5 Nov 2020 09:16:53 +0000 (10:16 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 5 Nov 2020 13:13:38 +0000 (14:13 +0100)
commit403f0dac0cb24184631e175836766a3a1da165a5
tree8677b341f940e393dbff05e53fae1f385f5c2540
parent199988774d74091e467aef695d0d985528360613
Fix SLP vectorization of stores from boolean vectors

The following fixes SLP vectorization of stores that were
pattern recognized.  Since in SLP vectorization pattern analysis
happens after dataref group analysis we have to adjust the groups
with the pattern stmts.  This has some effects down the pipeline
and exposes cases where we looked at the wrong pattern/non-pattern
stmts.

2020-11-05  Richard Biener  <rguenther@suse.de>

* tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
Use the original stmts.
(vect_slp_analyze_node_alignment): Use the pattern stmt.
* tree-vect-slp.c (vect_fixup_store_groups_with_patterns):
New function.
(vect_slp_analyze_bb_1): Call it.

* gcc.dg/vect/bb-slp-69.c: New testcase.
gcc/testsuite/gcc.dg/vect/bb-slp-69.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c
gcc/tree-vect-slp.c