Fix PR8728, a miscompilation I recently introduced. When optimizing
authorChris Lattner <sabre@nondot.org>
Mon, 6 Dec 2010 01:48:06 +0000 (01:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 6 Dec 2010 01:48:06 +0000 (01:48 +0000)
commitcc10244d7725f191bdc91cd62befff0c97257c7b
tree79ce2ec92470d1999df7a3eae7b934c8b9242211
parent72c194a8be83d217360ebc6b1f3ad21c5ffa16a9
Fix PR8728, a miscompilation I recently introduced.  When optimizing
memcpy's like:
  memcpy(A, B)
  memcpy(A, C)

we cannot delete the first memcpy as dead if A and C might be aliases.
If so, we actually get:

  memcpy(A, B)
  memcpy(A, A)

which is not correct to transform into:

  memcpy(A, A)

This patch was heavily influenced by Jakub Staszak's patch in PR8728, thanks
Jakub!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120974 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/AliasAnalysis.h
lib/Transforms/Scalar/DeadStoreElimination.cpp
test/Transforms/DeadStoreElimination/simple.ll