The memcpy optimizer was happily doing call slot forwarding when the new memory
authorDuncan Sands <baldrick@free.fr>
Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)
commitc6ada69a147171332b9485ef28392ddf57be26b1
tree61b0dc53e6a761717f5765da6863e4f2e38f6185
parent43c8b46deb9ca25797b1a8525067e1b6bd551979
The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old.  In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory.  Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible.  Should fix the gcc-4.7 self-host
buildbot failure.

llvm-svn: 165220
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/test/Transforms/MemCpyOpt/align.ll