[PATCH] D97984: ARM: Set MaxAtomicSizeInBitsSupported appropriately.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 14:30:38 PST 2021


jyknight created this revision.
jyknight added a reviewer: t.p.northover.
Herald added subscribers: jfb, hiraditya, kristof.beyls.
Herald added a reviewer: jfb.
jyknight requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This will result in larger atomic operations getting expanded to
__atomic_* libcalls via AtomicExpandPass. This is a part of a change
to similarly clean up atomics handling on all targets.

When ldrex is available, we can support lock-free atomics up to 32
bits. When ldrexd is available, 64 bits.

When neither are available, we can still support up to 32-bit
lock-free atomics on certain platforms, if they provide
kernel-assisted cmpxchg. In that case, we can emit native 32-bit loads
and stores, and emit rmw/cmpxchg via __sync_* libcalls. 64-bit atomics
are not supported similarly, because 64-bit loads/stores aren't
atomic.

Finally, refactor/simplify the remainder of the code, which no longer
needs to try to deal with oversized atomics.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97984

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMSubtarget.cpp
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/test/CodeGen/ARM/atomic-64bit.ll
  llvm/test/CodeGen/ARM/atomic-load-store.ll
  llvm/test/CodeGen/ARM/atomic-op.ll
  llvm/test/CodeGen/ARM/atomic-ops-m33.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97984.328313.patch
Type: text/x-patch
Size: 32260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/8579f5ff/attachment.bin>


More information about the llvm-commits mailing list