[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)
commit8eca988b00ad9dde185183c664f422615ef87b48
tree259707a74afcec16daab8b64e5f9f5cc14973513
parent4652459f64ed33e0bc21e9044b0a351c39c067c7
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237874 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll