diff options
author | James Y Knight <jyknight@google.com> | 2024-05-16 18:24:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 18:24:23 -0400 |
commit | d6f9278ae9e587d2d23a9940a2364aaafba74735 (patch) | |
tree | d873a426eb3c0f3a17a936fb94b129b798eff415 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 84abe0a6d4face73c15ed6344be74ae231f18718 (diff) | |
download | llvm-d6f9278ae9e587d2d23a9940a2364aaafba74735.zip llvm-d6f9278ae9e587d2d23a9940a2364aaafba74735.tar.gz llvm-d6f9278ae9e587d2d23a9940a2364aaafba74735.tar.bz2 |
[X86] Use plain load/store instead of cmpxchg16b for atomics with AVX (#74275)
In late 2021, both Intel and AMD finally documented that every
AVX-capable CPU has always been guaranteed to execute aligned 16-byte
loads/stores atomically, and further, guaranteed that all future CPUs
with AVX will do so as well.
Therefore, we may use normal SSE 128-bit load/store instructions to
implement atomics, if AVX is enabled.
Per AMD64 Architecture Programmer's manual, 7.3.2 Access Atomicity:
> Processors that report [AVX] extend the atomicity for cacheable,
> naturally-aligned single loads or stores from a quadword to a double
> quadword.
Per Intel's SDM:
> Processors that enumerate support for Intel(R) AVX guarantee that the
> 16-byte memory operations performed by the following instructions will
> always be carried out atomically:
> - MOVAPD, MOVAPS, and MOVDQA.
> - VMOVAPD, VMOVAPS, and VMOVDQA when encoded with VEX.128.
> - VMOVAPD, VMOVAPS, VMOVDQA32, and VMOVDQA64 when encoded with
> EVEX.128 and k0 (masking disabled).
This was also confirmed to be true for Zhaoxin CPUs with AVX, in
https://gcc.gnu.org/PR104688
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions