Implement PR8644: forwarding a memcpy value to a byval,
commit952210e39439fae6eb5b9832a36253bd430fd1be
authorChris Lattner <sabre@nondot.org>
Sun, 21 Nov 2010 00:28:59 +0000 (21 00:28 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 21 Nov 2010 00:28:59 +0000 (21 00:28 +0000)
tree0368003df16ef9b625afc9cdca10357bf6f22268
parentbbb7839cd5f8dfc827a9175efe6e898cb522f6ff
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