[PATCH] D101164: [CodeGen][ARM] Implement atomicrmw as pseudo operations at -O0

Tomas Matheson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 07:25:08 PDT 2021


tmatheson created this revision.
Herald added subscribers: danielkiss, jfb, hiraditya, kristof.beyls.
tmatheson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

atomicrmw instructions are expanded by AtomicExpandPass before register allocation
into cmpxchg loops. Register allocation can insert spills between the exclusive loads
and stores, which invalidates the exclusive monitor and can lead to infinite loops.

To avoid this, reimplement atomicrmw operations as pseudo-instructions and expand them
after register allocation.

Floating point legalisation:
f16 ATOMIC_LOAD_FADD(*f16, f16) is legalised to
f32 ATOMIC_LOAD_FADD(*i16, f32) and then eventually
f32 ATOMIC_LOAD_FADD_16(*i16, f32)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101164

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
  llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMInstrInfo.td
  llvm/test/CodeGen/ARM/atomicrmw_exclusive_monitor_all.ll
  llvm/test/Transforms/AtomicExpand/ARM/atomicrmw-fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101164.340025.patch
Type: text/x-patch
Size: 60931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210423/d98c788b/attachment-0001.bin>


More information about the llvm-commits mailing list