[PATCH] D15352: [EarlyCSE] DSE of atomic unordered stores

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 14:17:59 PST 2015


reames created this revision.
reames added reviewers: jfb, dberlin, majnemer, morisset, sanjoy, hfinkel.
reames added a subscriber: llvm-commits.

The rules for removing trivially dead stores are a lot less complicated than loads.  Since we know the later store post dominates the former, unless the former has side effects other than the actual store, we can remove it.  One slightly surprising thing is that we can freely remove atomic stores, even if the later one isn't atomic.  There's no guarantee the atomic one was every visible.  

(I'd really appreciate a sanity check on the preceding argument.  That somewhat surprised me when I realized it.)

For the moment, we don't handle DSE of ordered atomic stores.  We could extend the same chain of reasoning to them, but the catch is we'd then have to model the ordering effect without a store instruction.  Since our fences are a stronger than our operation orderings, simple using a fence isn't an obvious win.  This arguable calls for a refinement in our fence specification, but that's (much) later work.

http://reviews.llvm.org/D15352

Files:
  lib/Transforms/Scalar/EarlyCSE.cpp
  test/Transforms/EarlyCSE/atomics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15352.42224.patch
Type: text/x-patch
Size: 5162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151208/fa1298b1/attachment.bin>


More information about the llvm-commits mailing list