[PATCH] D137980: [ARM] Pretend atomics are always lock-free for small widths.

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 13:42:33 PST 2022


efriedma created this revision.
efriedma added reviewers: nikic, t.p.northover, john.brawn, joerg, tomhughes, alanphipps, aykevl.
Herald added subscribers: s.egerton, simoncook, hiraditya, kristof.beyls.
Herald added a project: All.
efriedma requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead.
Herald added projects: clang, LLVM.

Trying to accurately model what the hardware actually supports seems to lead to a lot of people complaining, and nobody saying it's actually helpful. So just pretend everything is lock-free, and let users deal with ensuring that the __sync_* routines are actually lock-free. If anyone complains, we can just say "gcc does the same thing".

Partially reverts D120026 <https://reviews.llvm.org/D120026>.  Makes D130480 <https://reviews.llvm.org/D130480> unnecessary.

Fixes https://github.com/llvm/llvm-project/issues/58603


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137980

Files:
  clang/lib/Basic/Targets/ARM.cpp
  clang/test/CodeGen/arm-atomics-m0.c
  clang/test/CodeGen/atomic-ops-libcall.c
  clang/test/CodeGen/atomics-inlining.c
  clang/test/CodeGen/c11atomics.c
  clang/test/CodeGen/pr45476.cpp
  clang/test/CodeGenCXX/threadsafe-statics-no-atomic.cpp
  clang/test/CodeGenOpenCL/atomic-ops-libcall.cl
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  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/thumbv6m-atomic32.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137980.475263.patch
Type: text/x-patch
Size: 50943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221114/feee0365/attachment-0001.bin>


More information about the cfe-commits mailing list