tree-optimization/98516 - fix SLP permute opt materialization
authorRichard Biener <rguenther@suse.de>
Tue, 5 Jan 2021 15:17:15 +0000 (16:17 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 5 Jan 2021 16:40:51 +0000 (17:40 +0100)
commit33a63257701c8d94ee375e32ff1837c989d8ded6
tree7bcc6ecd57ee6bbee583ae126b0892fd66ade9af
parent606f2af1973d5c83877d327cb5adef97c4243a73
tree-optimization/98516 - fix SLP permute opt materialization

When materializing on a VEC_PERM node we have to permute the
incoming vectors, not the outgoing one.

2021-01-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98516
* tree-vect-slp.c (vect_optimize_slp): Permute the incoming
lanes when materializing on a VEC_PERM node.
(vectorizable_slp_permutation): Dump the permute properly.

* gcc.dg/vect/bb-slp-pr98516-1.c: New testcase.
* gcc.dg/vect/bb-slp-pr98516-2.c: Likewise.
gcc/testsuite/gcc.dg/vect/bb-slp-pr98516-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/bb-slp-pr98516-2.c [new file with mode: 0644]
gcc/tree-vect-slp.c