instcombine: Migrate strcpy optimizations
authorMeador Inge <meadori@codesourcery.com>
Thu, 18 Oct 2012 18:12:40 +0000 (18:12 +0000)
committerMeador Inge <meadori@codesourcery.com>
Thu, 18 Oct 2012 18:12:40 +0000 (18:12 +0000)
commit000dbccfc68e92305854b273104eb8e7530aa949
treed40e2e5a223b410762ec57112fa8036b11b0d2ce
parent71a19ecd41f9f2989a0bd95f1bd4adb4f5a52dda
instcombine: Migrate strcpy optimizations

This patch migrates the strcpy optimizations from the simplify-libcalls pass
into the instcombine library call simplifier.  Note also that StrCpyChkOpt
has been updated with a few simplifications that were being done in the
simplify-libcalls version of StrCpyOpt, but not in the migrated implementation
of StrCpyOpt.  There is no reason to overload StrCpyOpt with fortified and
regular simplifications in the new model since there is already a dedicated
simplifier for __strcpy_chk.

llvm-svn: 166198
llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/strcpy-1.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/strcpy-2.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/strcpy_chk-1.ll
llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll [deleted file]