tree-optimization/101267 - fix SLP vect with masked operations
authorRichard Biener <rguenther@suse.de>
Wed, 30 Jun 2021 10:35:45 +0000 (12:35 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 30 Jun 2021 14:40:12 +0000 (16:40 +0200)
commita075350ee7bffa6c90d9d233de78515f498b5149
tree4bfcc0cb63c94c7cbdd8928be01a281c1de906d8
parente61ffa201403e3814a43b176883e176716b1492f
tree-optimization/101267 - fix SLP vect with masked operations

This fixes the missed handling of external/constant mask SLP
operations, for the testcase in particular masked loads.  The
patch adjusts the vect_check_scalar_mask API to reflect the
required vect_is_simple_use SLP compatible API plus adjusts
for the special handling of masked loads in SLP discovery.

The issue is likely latent.

2021-06-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101267
* tree-vect-stmts.c (vect_check_scalar_mask): Adjust
API and use SLP compatible interface of vect_is_simple_use.
Reject not vectorized SLP defs for callers that do not support
that.
(vect_check_store_rhs): Handle masked stores and pass down
the appropriate operator index.
(vectorizable_call): Adjust.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.  Handle SLP pecularity of
masked loads.
(vect_is_simple_use): Remove special-casing of masked stores.

* gfortran.dg/pr101267.f90: New testcase.
gcc/testsuite/gfortran.dg/pr101267.f90 [new file with mode: 0644]
gcc/tree-vect-stmts.c