llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[AArch64] cmpxchg not using Armv8.1-a instructions at -O0

Open cddouma-arm opened this issue 9 years ago • 1 comments

Bugzilla Link 35072
Resolution FIXED
Resolved on May 27, 2021 11:52
Version trunk
OS All
Attachments reproducer
CC @Arnaud-de-Grandmaison-ARM,@efriedma-quic,@fhahn,@smithp35

Extended Description

The Armv8.1-a target has a compare-and-swap (CAS) instruction which is used to implement cmpxchg operation of LLVM IR. However, at -O0 the code generator is still emitting a long code sequence to emulate this instruction.

LLVM should use CAS even at -O0.

A reproducer that show the behaviour is attached. Compile using: llc -mattr=+v8.1a cmpxchg.ll -O[0|2]

cddouma-arm avatar Oct 25 '17 13:10 cddouma-arm

We correctly produce cas on trunk.

efriedma-quic avatar May 27 '21 18:05 efriedma-quic