diff options
author | Richard Biener <rguenther@suse.de> | 2023-06-13 08:52:23 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-06-13 10:40:25 +0200 |
commit | 1c3661e224e3ddfc6f773b095740c0f5a7ddf5fc (patch) | |
tree | ee895940afb8c83ad8da7ff6baebd0b8fc894ff3 | |
parent | 17714c08e9013b51cf8d04ac39f844d355c923f2 (diff) | |
download | gcc-1c3661e224e3ddfc6f773b095740c0f5a7ddf5fc.zip gcc-1c3661e224e3ddfc6f773b095740c0f5a7ddf5fc.tar.gz gcc-1c3661e224e3ddfc6f773b095740c0f5a7ddf5fc.tar.bz2 |
Fix disambiguation against .MASK_LOAD
Alias analysis was treating .MASK_LOAD as storing a full vector
which means we disambiguate against decls of smaller than vector size.
This complements the previous patch handling .MASK_STORE and fixes
runtime execution FAILs of gfortran.dg/matmul_3.f90 and
gfortran.dg/inline_sum_2.f90 when using AVX512 with full masked loop
vectorization on Zen4.
* tree-ssa-alias.cc (ref_maybe_used_by_call_p_1): For
.MASK_LOAD and friends set the size of the access to unknown.
-rw-r--r-- | gcc/tree-ssa-alias.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index b5476e8..e1bc04b8 100644 --- a/gcc/tree-ssa-alias.cc +++ b/gcc/tree-ssa-alias.cc @@ -2829,6 +2829,9 @@ ref_maybe_used_by_call_p_1 (gcall *call, ao_ref *ref, bool tbaa_p) ao_ref_init_from_ptr_and_size (&rhs_ref, gimple_call_arg (call, 0), TYPE_SIZE_UNIT (TREE_TYPE (lhs))); + /* We cannot make this a known-size access since otherwise + we disambiguate against refs to decls that are smaller. */ + rhs_ref.size = -1; rhs_ref.ref_alias_set = rhs_ref.base_alias_set = tbaa_p ? get_deref_alias_set (TREE_TYPE (gimple_call_arg (call, 1))) : 0; @@ -3073,7 +3076,7 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref, bool tbaa_p) ao_ref_init_from_ptr_and_size (&lhs_ref, gimple_call_arg (call, 0), TYPE_SIZE_UNIT (TREE_TYPE (rhs))); /* We cannot make this a known-size access since otherwise - we disambiguate against stores to decls that are smaller. */ + we disambiguate against refs to decls that are smaller. */ lhs_ref.size = -1; lhs_ref.ref_alias_set = lhs_ref.base_alias_set = tbaa_p ? get_deref_alias_set |