AArch64: use indivisible cmpxchg for 128-bit atomic loads at O0
authorTim Northover <t.p.northover@gmail.com>
Wed, 22 Sep 2021 12:06:55 +0000 (13:06 +0100)
committerTim Northover <t.p.northover@gmail.com>
Wed, 22 Sep 2021 13:20:43 +0000 (14:20 +0100)
commit3a00e58c2fca0c20d3792c897ef1ea54b6a168a0
tree48321e58d4178b1dbe0544d3d14bfeea1e7200f8
parent05b130342143a0c93407cfbecf6d7cf30c6d1890
AArch64: use indivisible cmpxchg for 128-bit atomic loads at O0

Like normal atomicrmw operations, at -O0 the simple register-allocator can
insert spills into the LL/SC loop if it's expanded and visible when regalloc
runs. This can cause the operation to never succeed by repeatedly clearing the
monitor. Instead expand to a cmpxchg, which has a pseudo-instruction for -O0.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic-128.ll