[PATCH] D15397: [EarlyCSE] DSE of stores which write back loaded values
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 15:25:13 PST 2015
reames created this revision.
reames added reviewers: jfb, majnemer, sanjoy, hfinkel, dberlin.
reames added a subscriber: llvm-commits.
Extend EarlyCSE with an additional style of dead store elimination. If we write back a value just read from that memory location, we can eliminate the store under the assumption that the value hasn't changed.
I'd really appreciate someone taking a close look at my "dse5" test case. I want to make sure the logic involved holds up. For normal loads and stores it clearly does - for the store to change the value, there must be a race. I believe it also holds for unordered atomics, but would really like a second opinion.
I'm implementing this mostly because I noticed the omission when looking at the code. It seemed strange to have InstCombine have a peephole which was more powerful than EarlyCSE. :)
http://reviews.llvm.org/D15397
Files:
lib/Transforms/Scalar/EarlyCSE.cpp
test/Transforms/EarlyCSE/basic.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15397.42350.patch
Type: text/x-patch
Size: 3936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151209/d532afdf/attachment.bin>
More information about the llvm-commits
mailing list