[AtomicExpandPass]: Add a hook for custom cmpxchg expansion in IR
authorAlex Bradbury <asb@lowrisc.org>
Wed, 19 Sep 2018 14:51:42 +0000 (14:51 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Wed, 19 Sep 2018 14:51:42 +0000 (14:51 +0000)
commit79518b02cd3ef91a9fb5ddae381e826e80cae582
tree57897012b6770236cb7b5981f3991538b2b4eb7f
parent023dfa5716326449662059516ddff2ed459526a1
[AtomicExpandPass]: Add a hook for custom cmpxchg expansion in IR

This involves changing the shouldExpandAtomicCmpXchgInIR interface, but I have
updated the in-tree backends using this hook (ARM, AArch64, Hexagon) so they
will see no functional change. Previously this hook returned bool, but it now
returns AtomicExpansionKind.

This hook allows targets to select how a given cmpxchg is to be expanded.
D48131 uses this to expand part-word cmpxchg to a target-specific intrinsic.

See my associated RFC for more info on the motivation for this change
<http://lists.llvm.org/pipermail/llvm-dev/2018-June/123993.html>.

Differential Revision: https://reviews.llvm.org/D48130

llvm-svn: 342550
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/AtomicExpandPass.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/lib/Target/Hexagon/HexagonISelLowering.h