[InstCombine] Convert atomicrmws to xchg or store where legal
authorPhilip Reames <listmail@philipreames.com>
Fri, 15 Feb 2019 21:23:51 +0000 (21:23 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 15 Feb 2019 21:23:51 +0000 (21:23 +0000)
commitcae6c767e886b587e3b6d698c186f75c941bb11d
tree81e3ede842a48e4cae19e289bb95867a1f6f537c
parente2bb3121fd4ab5b01f9ec1d2e3e9877db9c6a54c
[InstCombine] Convert atomicrmws to xchg or store where legal

Implement two more transforms of atomicrmw:
1) We can convert an atomicrmw which produces a known value in memory into an xchg instead.
2) We can convert an atomicrmw xchg w/o users into a store for some orderings.

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

llvm-svn: 354170
llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
llvm/test/Transforms/InstCombine/atomicrmw.ll