Implement PR8644: forwarding a memcpy value to a byval,
authorChris Lattner <sabre@nondot.org>
Sun, 21 Nov 2010 00:28:59 +0000 (00:28 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 21 Nov 2010 00:28:59 +0000 (00:28 +0000)
commit2f5f90ad3e9b00cf21ae8e3f55b93f0be1d504c3
tree0368003df16ef9b625afc9cdca10357bf6f22268
parenta6fd81dd7f6039fbc1a55f6f4d45659fffdd81fb
Implement PR8644: forwarding a memcpy value to a byval,
allowing the memcpy to be eliminated.

Unfortunately, the requirements on byval's without explicit
alignment are really weak and impossible to predict in the
mid-level optimizer, so this doesn't kick in much with current
frontends.  The fix is to change clang to set alignment on all
byval arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119916 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/CallSite.h
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/memcpy.ll
test/Transforms/MemCpyOpt/sret.ll