OSDN Git Service

[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 11 May 2015 23:09:46 +0000 (23:09 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 11 May 2015 23:09:46 +0000 (23:09 +0000)
commit6eb095d7ae616b6aaa1330ea4a47dc79ae4c1b23
tree571126eb5c8e403a7c83a59ae9583fe3965db9fc
parent12a7fbc55c1b28eafeae34d3af8cf98ec24da689
[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.

This fixes another miscompile introduced by r235232: when there was a
dependency on the memcpy destination other than the memset, we would
ignore it, because we only looked at the source dependency.

It was a mistake to use SrcDepInfo.  Instead, just use DepInfo.

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