[PATCH] D95891: [ARM] Do not emit ldrexd/strexd on Cortex-M chips

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 12:14:36 PST 2021


aykevl created this revision.
aykevl added reviewers: SjoerdMeijer, samtebbs, samparker.
aykevl added a project: LLVM.
Herald added subscribers: danielkiss, jfb, hiraditya, kristof.beyls, yaxunl.
aykevl requested review of this revision.
Herald added a subscriber: llvm-commits.

The ldrexd/strexd instructions are not supported on M-class chips, see for example https://developer.arm.com/documentation/dui0489/e/arm-and-thumb-instructions/memory-access-instructions/ldrex-and-strex which says:

> All these 32-bit Thumb instructions are available in ARMv6T2 and
> above, except that LDREXD and STREXD are not available in the ARMv7-M
> architecture.

Looking at the ARMv8-M architecture, it appears that these instructions aren't supported either. The Architecture Reference Manual lists ldrex/strex but not ldrexd/strexd: https://developer.arm.com/documentation/ddi0553/bn/

Godbolt example on LLVM 11.0.0, which incorrectly emits ldrexd/strexd instructions: https://llvm.godbolt.org/z/5qqPnE


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95891

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/ARM/atomic-64bit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95891.320876.patch
Type: text/x-patch
Size: 4610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210202/8bcbb28f/attachment.bin>


More information about the llvm-commits mailing list