Fix vectorizable_mask_load_store handling of invariant masks
commit6e854573a5e15d7fa60104a9480569eb890ef4ff
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2017 15:32:01 +0000 (18 15:32 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2017 15:32:01 +0000 (18 15:32 +0000)
tree9379eaf16d2d7e38dd329db4ae50c0e17c96aa3a
parentf9674f3d59b2a61bd779632cd23679383a60a22f
Fix vectorizable_mask_load_store handling of invariant masks

vectorizable_mask_load_store was not passing the required mask type to
vect_get_vec_def_for_operand.  This doesn't matter for masks that are
defined in the loop, since their STMT_VINFO_VECTYPE will be what we need
anyway.  But it's not possible to tell which mask type the caller needs
when looking at an invariant scalar boolean.  As the comment above the
function says:

   In case OP is an invariant or constant, a new stmt that creates a vector def
   needs to be introduced.  VECTYPE may be used to specify a required type for
   vector invariant.

This fixes the attached testcase for SVE.

2017-09-18  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* tree-vect-stmts.c (vectorizable_mask_load_store): Pass mask_vectype
to vect_get_vec_def_for_operand when getting the mask operand.

gcc/testsuite/
* gfortran.dg/vect/mask-store-1.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252932 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/vect/mask-store-1.f90 [new file with mode: 0644]
gcc/tree-vect-stmts.c