[PATCH] D124247: [Trivial Dead] Consider any non volatile load as trivially dead independent on ordering
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 04:23:59 PDT 2022
skatkov created this revision.
skatkov added reviewers: reames, fhahn, nikic, rampitec, efriedma, timshen.
Herald added subscribers: kerbowa, hiraditya, jvesely, nemanjai.
Herald added a project: All.
skatkov requested review of this revision.
Herald added a project: LLVM.
None volatile load can be considered as trivial dead independent on atomic
semantic. This is based on the fact that release-acquire synchronization
happens only if load reads the value written by store-release operation.
As soone as load instruction does not have uses, so no one will check what
actually value has been read. So optimizer may suggest that load reads the
value was before store release happened and so no synchronization happened.
This allows us simply to remove this load.
https://reviews.llvm.org/D124247
Files:
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/CodeGen/AMDGPU/noclobber-barrier.ll
llvm/test/CodeGen/PowerPC/atomics-constant.ll
llvm/test/Transforms/EarlyCSE/atomics.ll
llvm/test/Transforms/EarlyCSE/basic.ll
llvm/test/Transforms/InstCombine/atomic.ll
llvm/test/Transforms/InstCombine/store.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124247.424429.patch
Type: text/x-patch
Size: 6632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220422/9de31821/attachment.bin>
More information about the llvm-commits
mailing list