diff options
author | liuhongt <hongtao.liu@intel.com> | 2024-08-15 12:54:07 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2024-08-22 10:31:42 +0800 |
commit | 27dc1533b6dfc49f3912c524db51d6c372a5ac3d (patch) | |
tree | e8fae411d8994713979c7f48859981102444eb57 /libstdc++-v3/include/bits/allocator.h | |
parent | ffd458d815d3fc8fe1ebacb9c7b9bc6917aa25e1 (diff) | |
download | gcc-releases/gcc-14.zip gcc-releases/gcc-14.tar.gz gcc-releases/gcc-14.tar.bz2 |
Align ix86_{move_max,store_max} with vectorizer.releases/gcc-14
When none of mprefer-vector-width, avx256_optimal/avx128_optimal,
avx256_store_by_pieces/avx512_store_by_pieces is specified, GCC will
set ix86_{move_max,store_max} as max available vector length except
for AVX part.
if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
&& TARGET_EVEX512_P (opts->x_ix86_isa_flags2))
opts->x_ix86_move_max = PVW_AVX512;
else
opts->x_ix86_move_max = PVW_AVX128;
So for -mavx2, vectorizer will choose 256-bit for vectorization, but
128-bit is used for struct copy, there could be a potential STLF issue
due to this "misalign".
The patch fixes that.
gcc/ChangeLog:
* config/i386/i386-options.cc (ix86_option_override_internal):
set ix86_{move_max,store_max} to PVW_AVX256 when TARGET_AVX
instead of PVW_AVX128.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pieces-memcpy-10.c: Add -mprefer-vector-width=128.
* gcc.target/i386/pieces-memcpy-6.c: Ditto.
* gcc.target/i386/pieces-memset-38.c: Ditto.
* gcc.target/i386/pieces-memset-40.c: Ditto.
* gcc.target/i386/pieces-memset-41.c: Ditto.
* gcc.target/i386/pieces-memset-42.c: Ditto.
* gcc.target/i386/pieces-memset-43.c: Ditto.
* gcc.target/i386/pieces-strcpy-2.c: Ditto.
* gcc.target/i386/pieces-memcpy-22.c: New test.
* gcc.target/i386/pieces-memset-51.c: New test.
* gcc.target/i386/pieces-strcpy-3.c: New test.
(cherry picked from commit 6ea25c041964bf63014fcf7bb68fb1f5a0a4e123)
Diffstat (limited to 'libstdc++-v3/include/bits/allocator.h')
0 files changed, 0 insertions, 0 deletions