Fold MASK_LOAD/STORE with an all-true mask
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 5 Aug 2019 16:46:58 +0000 (16:46 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 5 Aug 2019 16:46:58 +0000 (16:46 +0000)
commit868363d4f52df19d8d5e9529b8906fa25c8d0c95
tree53d8dc707b6539ee636b896399f561e66e1c88d6
parent779724a5913b4e6a7ccccc0b8b415a772144a067
Fold MASK_LOAD/STORE with an all-true mask

This patch folds IFN_MASK_LOAD and IFN_MASK_STOREs to normal accesses
if the mask is all-true.  This can happen for fully-masked loops that
didn't actually need to be (which could be handled by the vectoriser
instead), or for unrolled fully-masked loops whose first iteration is
guaranteed to operate on a full vector.  It's also useful when the
accesses are generated directly by intrinsics (to follow for SVE).

2019-08-05  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* gimple-fold.c (gimple_fold_mask_load_store_mem_ref)
(gimple_fold_mask_load, gimple_fold_mask_store): New functions.
(gimple_fold_call): Use them to fold IFN_MASK_LOAD and
IFN_MASK_STORE.

gcc/testsuite/
* gcc.target/aarch64/sve/mask_load_1.c: New test.

From-SVN: r274118
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/mask_load_1.c [new file with mode: 0644]