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. :)