[PATCH] D103284: [AArch64][RISCV] Make sure isel correctly honors failure orderings.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 13:52:27 PDT 2021


efriedma created this revision.
efriedma added reviewers: craig.topper, jyknight, t.p.northover.
Herald added subscribers: vkmr, frasercrmck, danielkiss, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, jfb, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, kristof.beyls.
efriedma requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

If a cmpxchg specifies acquire or seq_cst on failure, make sure we generate code consistent with that ordering even if the success ordering is not acquire/seq_cst.

At one point, it was ambiguous whether this sort of construct was valid, but the C++ standad and LLVM now accept arbitrary combinations of success/failure orderings.

This doesn't address the corresponding issue in AtomicExpand.  (This was reported as https://bugs.llvm.org/show_bug.cgi?id=33332 .)

Fixes https://bugs.llvm.org/show_bug.cgi?id=50512.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103284

Files:
  llvm/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h
  llvm/include/llvm/CodeGen/MachineMemOperand.h
  llvm/include/llvm/CodeGen/SelectionDAGNodes.h
  llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic.ll
  llvm/test/CodeGen/AArch64/atomic-ops-lse.ll
  llvm/test/CodeGen/RISCV/atomic-cmpxchg.ll
  llvm/utils/TableGen/CodeGenDAGPatterns.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103284.348377.patch
Type: text/x-patch
Size: 140642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210527/36969636/attachment-0001.bin>


More information about the llvm-commits mailing list