[MemCpyOpt] Do move the memset, but look at its dest's dependencies.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 21 May 2015 01:43:39 +0000 (01:43 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 21 May 2015 01:43:39 +0000 (01:43 +0000)
commit97876fa894222ea2c11923c1dbe2b7647e424fe9
tree00a2265729452f775fc0eb805a42b3c9dd0d7a46
parent5435aa464a62f4d82fbe643ade6fdcc40acbd141
[MemCpyOpt] Do move the memset, but look at its dest's dependencies.

In effect a partial revert of r237858, which was a dumb shortcut.
Looking at the dependencies of the destination should be the proper
fix: if the new memset would depend on anything other than itself,
the transformation isn't correct.

llvm-svn: 237874
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/test/Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll