[PATCH] D109827: AArch64: use ldp/stp for 128-bit atomic load/store with v8.4

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 15 07:04:06 PDT 2021


t.p.northover created this revision.
t.p.northover added a reviewer: paquette.
Herald added subscribers: hiraditya, kristof.beyls, mcrosier.
t.p.northover requested review of this revision.
Herald added a project: LLVM.

Prior to v8.4a[*] the only way to get a 128-bit atomic load or store was via `ldxp`/`stxp` (or `casp`), which is not only inefficient but outright impossible without write access. So v8.4a extended the memory model so that any 16-byte operation aligned to 16 bytes (as all LLVM atomic load/stores must be) is atomic.

This patch implements ISel for these instructions in both SDAG and GISel. In both cases we go for `ldp`/`stp` implementations since atomics are much more likely to be GPR-based operations.


https://reviews.llvm.org/D109827

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
  llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic-128.ll
  llvm/test/CodeGen/AArch64/atomic-ops-lse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109827.372688.patch
Type: text/x-patch
Size: 13553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210915/9a33715e/attachment-0001.bin>


More information about the llvm-commits mailing list