]> gcc.gnu.org Git - gcc.git/commit
vect, aarch64: Fix alignment units for IFN_MASK* [PR95401]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Jan 2021 09:55:47 +0000 (09:55 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Jan 2021 09:55:47 +0000 (09:55 +0000)
commit4e07a6f33bea27b5f22bf3c4d0fdd5e1a9401073
tree2239cc867f91014421fc4fbfae4219f59283bcc3
parentad15ddcbf450aec12191e0affeab9b1b0477881e
vect, aarch64: Fix alignment units for IFN_MASK* [PR95401]

The IFN_MASK* functions take two leading arguments: a load or
store pointer and a “cookie”.  The type of the cookie is the
type of the access for TBAA purposes (like for MEM_REFs)
while the value of the cookie is the alignment of the access.
This PR was caused by a disagreement about whether the alignment
is measured in bits or bytes.

It looks like this goes back to PR68786, which made the
vectoriser create its own cookie argument rather than reusing
the one created by ifcvt.  The alignment value of the new cookie
was measured in bytes (as needed by set_ptr_info_alignment)
while the existing code expected it to be measured in bits.
The folds I added for IFN_MASK_LOAD and STORE then made
things worse.

gcc/
PR tree-optimization/95401
* config/aarch64/aarch64-sve-builtins.cc
(gimple_folder::load_store_cookie): Use bits rather than bytes
for the alignment argument to IFN_MASK_LOAD and IFN_MASK_STORE.
* gimple-fold.c (gimple_fold_mask_load_store_mem_ref): Likewise.
* tree-vect-stmts.c (vectorizable_store): Likewise.
(vectorizable_load): Likewise.

gcc/testsuite/
PR tree-optimization/95401
* g++.dg/vect/pr95401.cc: New test.
* g++.dg/vect/pr95401a.cc: Likewise.

(cherry picked from commit aa204d511859e4859cbe35a867ac407addb4ff54)
gcc/config/aarch64/aarch64-sve-builtins.cc
gcc/gimple-fold.c
gcc/testsuite/g++.dg/vect/pr95401.cc [new file with mode: 0644]
gcc/testsuite/g++.dg/vect/pr95401a.cc [new file with mode: 0644]
gcc/tree-vect-stmts.c
This page took 1.100428 seconds and 5 git commands to generate.