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

Nick Lewycky nlewycky at google.com
Mon Sep 24 15:15:21 PDT 2012


On 24 September 2012 15:00, Eli Friedman <eli.friedman at gmail.com> wrote:

> 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.
>

Thanks. I've gone ahead and submitted it in two patches, with the business
end in the second patch, since I'm more confident it's correct than I was
earlier. I'd appreciate post-commit review on the patch!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120924/5ee38f8a/attachment.html>


More information about the llvm-commits mailing list