]> granicus.if.org Git - llvm/commit
Canonicalize all integer "idempotent" atomicrmw ops
authorPhilip Reames <listmail@philipreames.com>
Thu, 14 Feb 2019 20:41:17 +0000 (20:41 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 14 Feb 2019 20:41:17 +0000 (20:41 +0000)
commitfae0ff6ec8d98bb94059496965e76b7e88c949e4
tree02ec7f59d9b33287390f6b1871d15cbee0a6a178
parent3e53c14be52f1a5c36952b3a3861202e3f201fc6
Canonicalize all integer "idempotent" atomicrmw ops

For "idempotent" atomicrmw instructions which we can't simply turn into load, canonicalize the operation and constant. This reduces the matching needed elsewhere in the optimizer, but doesn't directly impact codegen.

For any architecture where OR/Zero is not a good default choice, you can extend the AtomicExpand lowerIdempotentRMWIntoFencedLoad mechanism. I reviewed X86 to make sure this works well, haven't audited other backends.

Differential Revision: https://reviews.llvm.org/D58244

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354058 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
test/Transforms/InstCombine/atomicrmw.ll