[PATCH] D57854: [InstCombine] Optimize `atomicrmw <op>, 0` into `load atomic` when possible

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 6 15:07:18 PST 2019


qcolombet created this revision.
qcolombet added reviewers: spatel, majnemer.
Herald added subscribers: jfb, mgorny.
Herald added a project: LLVM.

This commit teaches InstCombine how to replace an atomicrmw operation
into a simple load atomic.
For a given `atomicrmw <op>`, this is possible when:

1. The ordering of that operation is compatible with a load (i.e., anything that doesn't have a release semantic).
2. <op> does not modify the value being stored


Repository:
  rL LLVM

https://reviews.llvm.org/D57854

Files:
  lib/Transforms/InstCombine/CMakeLists.txt
  lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
  lib/Transforms/InstCombine/InstCombineInternal.h
  test/Transforms/InstCombine/atomicrmw.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57854.185651.patch
Type: text/x-patch
Size: 5877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190206/1f8be164/attachment.bin>


More information about the llvm-commits mailing list