[llvm-commits] patch: DSE for str[n]{cat,cpy}

Eli Friedman eli.friedman at gmail.com
Mon Sep 24 15:00:26 PDT 2012


On Mon, Sep 24, 2012 at 2:44 PM, Nick Lewycky <nlewycky at google.com> wrote:
> This patch extends dead store elimination to treat
> strcpy/strncpy/strcat/strncat as stores that can be removed. There are some
> more functions we could do this for, such as
> sprintf/snprintf/vsprintf/vsnprintf, but TargetLibraryInfo doesn't have
> entries for those yet.
>
> The test uses -basicaa to get the target library info, but I don't specify a
> triple because at the moment there are no targets which disable strcpy and
> friends. Ideas for future-proofing this would be appreciated.

Can you extract the change to add "TLI = AA->getTargetLibraryInfo();"
etc. out into a separate patch?  That would make it a bit easier to
review.

The concept seems fine; I didn't look too closely at the details.

-Eli



More information about the llvm-commits mailing list