[llvm-commits] [PATCH] Teach SimplifyLibCalls about stpcpy
David Majnemer
david.majnemer at gmail.com
Mon May 14 08:29:32 PDT 2012
On Mon, May 14, 2012 at 2:09 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi David,
>
>> I briefly noticed that strcpy(x, x) for arbitrary x is always turned
>> into a no-op. I figured that stpcpy can easily handle this case if we
>> are willing to calculate strlen(x); this seems like it should always
>> be a net win versus going to the library implementation of stpcpy.
>
> don't forget to add a testcase for this feature.
Added a test case for the stpcpy(x, x) optimization.
--
David Majnemer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simplify_stpcpy3.patch
Type: application/octet-stream
Size: 6116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120514/bfdde5d0/attachment.obj>
More information about the llvm-commits
mailing list