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)
commit0c41d57b09884b92f988cb88553eaa7c77819d4b
treee7e0a193da3c7773595db3dfce083614dc597bd7
parent77ed3424e41cfb06600dbc7c138a565be71cfb95
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166198 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SimplifyLibCalls.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/strcpy-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/strcpy-2.ll [new file with mode: 0644]
test/Transforms/InstCombine/strcpy_chk-1.ll
test/Transforms/SimplifyLibCalls/StrCpy.ll [deleted file]