[AtomicExpandPass][AArch64] Promote xchg with floating-point types to integer ones
authorLemonBoy <thatlemon@gmail.com>
Sat, 29 May 2021 06:50:34 +0000 (08:50 +0200)
committerLemonBoy <thatlemon@gmail.com>
Sat, 29 May 2021 06:57:27 +0000 (08:57 +0200)
commitb577ec495698c585837db3893c5662d3aa0aab87
tree14266e3a12190e867cfef396dd13b59f37f50c28
parentcdd1adfb7d5d5048a7fdedc441e75db019fbb0b5
[AtomicExpandPass][AArch64] Promote xchg with floating-point types to integer ones

Follow the same strategy used for atomic loads/stores by converting the operands to equally-sized integer types.
This change prevents the atomic expansion pass from generating illegal LL/SC pairs when targeting AArch64: `expand-atomicrmw-xchg-fp.ll` would previously instantiate intrinsics such as `llvm.aarch64.ldaxr.p0f32` that cannot be lowered.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D103232
llvm/lib/CodeGen/AtomicExpandPass.cpp
llvm/test/CodeGen/AArch64/atomicrmw-xchg-fp.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/atomicf128.ll
llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
llvm/test/Transforms/AtomicExpand/X86/expand-atomic-xchg-fp.ll