[PATCH] D59345: Allow code motion (and thus folding) for atomic (but unordered) memory operands

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 21:32:22 PDT 2019


reames created this revision.
reames added reviewers: jlebar, jfb, craig.topper.
Herald added subscribers: bollu, mcrosier.
Herald added a project: LLVM.

Building on the work done in  D57601 <https://reviews.llvm.org/D57601>, now that we can distinguish between atomic and volatile memory accesses, go ahead and allow code motion of unordered atomics.  As seen in the diffs, this allows much better folding of memory operations into using instructions.  (Mostly done by the PeepholeOpt pass.)

Note: I have not reviewed all callers of hasOrderedMemoryRef since one of them - isSafeToMove - is very widely used.  I'm relying on the documented semantics of each method to judge correctness.


Repository:
  rL LLVM

https://reviews.llvm.org/D59345

Files:
  lib/CodeGen/MachineInstr.cpp
  test/CodeGen/X86/atomic-non-integer.ll
  test/CodeGen/X86/atomic-unordered.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59345.190565.patch
Type: text/x-patch
Size: 12675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190314/779f2176/attachment.bin>


More information about the llvm-commits mailing list