[DSE] Remove noop stores in MSSA.
authorzoecarver <z.zoelec2@gmail.com>
Sat, 30 May 2020 16:56:04 +0000 (09:56 -0700)
committerzoecarver <z.zoelec2@gmail.com>
Sat, 30 May 2020 16:57:30 +0000 (09:57 -0700)
commit065bf124fde8fd9d37eba0a387833cdfe9e68d08
tree0349f20690a6145ab46ba20600925f1982228799
parentfd0ab3b3eb88de3fe4792c34b50084595e22d68d
[DSE] Remove noop stores in MSSA.

Adds a simple fast-path check for the pattern:
v = load ptr
store v to ptr

I took the tests from the bugzilla post, I can add more if needed (but I think these should be sufficent).

Refs: https://bugs.llvm.org/show_bug.cgi?id=45795

Differential Revision: https://reviews.llvm.org/D79391
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/MSSA/atomic.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll [new file with mode: 0644]
llvm/test/Transforms/DeadStoreElimination/MSSA/simple-todo.ll