[PATCH] D58846: Adding an option to use for targets that do not have support for atomic load-modify-store instructions

Maya Madhavan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 13:39:07 PST 2019


maya.madhavan created this revision.
maya.madhavan added reviewers: jyknight, olista01.
maya.madhavan added projects: LLVM, clang.
Herald added subscribers: llvm-commits, jfb, hiraditya, kristof.beyls, javed.absar.

The ARM documentation for ARMv7-M indicates that atomic read-modify-write operations can be implemented using LDREX/STREX loops but some Cortex-M4 hardware implementations including ti_sitara_m4 and fsl_imx6sx_m4 do not provide the "global monitor" required to support exclusive load/stores. On such hardware, use of LDREX/STREX leads to a bus error (Signal 10) or segmentation fault (Signal 11).

See:
http://e2e.ti.com/support/arm/automotive_processors/f/1021/t/708195?tisearch=e2e-quicksearch&keymatch=ldrex
https://e2e.ti.com/support/legacy_forums/embedded/tirtos/f/355/p/541932/1979054#1979054

The "mno-gm" option (gm for Global Monitor) suppresses the generation of these RMW instructions and uses libcalls instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D58846

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Arch/ARM.cpp
  llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
  llvm/lib/CodeGen/AtomicExpandPass.cpp
  llvm/lib/CodeGen/TargetSubtargetInfo.cpp
  llvm/lib/Target/ARM/ARM.td
  llvm/lib/Target/ARM/ARMInstrInfo.td
  llvm/lib/Target/ARM/ARMInstrThumb2.td
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/test/CodeGen/ARM/atomic-nogm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58846.188967.patch
Type: text/x-patch
Size: 14812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/b5c0398a/attachment.bin>


More information about the llvm-commits mailing list