From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr
Date: Wed, 21 Sep 2022 15:02:33 -0700 [thread overview]
Message-ID: <CAFUsyfLBHJ_Fjh5deSamVa5c=Ua4B9Wj_MPrFfgowbJfDTvrJA@mail.gmail.com> (raw)
In-Reply-To: <74183249-3937-af58-207f-ec41333384d2@gmail.com>
On Sat, Jul 9, 2022 at 8:59 AM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 6/21/2022 12:12 PM, Noah Goldstein via Gcc-patches wrote:
> > This patch allows for strchr(x, c) to the replace with memchr(x, c,
> > strlen(x) + 1) if strlen(x) has already been computed earlier in the
> > tree.
> >
> > Handles PR95821: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95821
> >
> > Since memchr doesn't need to re-find the null terminator it is faster
> > than strchr.
> >
> > bootstrapped and tested on x86_64-linux.
> >
> > PR tree-optimization/95821
> >
> > gcc/
> >
> > * tree-ssa-strlen.cc (strlen_pass::handle_builtin_strchr): Emit
> > memchr instead of strchr if strlen already computed.
> >
> > gcc/testsuite/
> >
> > * c-c++-common/pr95821-1.c: New test.
> > * c-c++-common/pr95821-2.c: New test.
> > * c-c++-common/pr95821-3.c: New test.
> > * c-c++-common/pr95821-4.c: New test.
> > * c-c++-common/pr95821-5.c: New test.
> > * c-c++-common/pr95821-6.c: New test.
> > * c-c++-common/pr95821-7.c: New test.
> > * c-c++-common/pr95821-8.c: New test.
> Given Jakub's involvement to-date and the fact this touches
> tree-ssa-strlen.cc I think Jakub should have final ACK/NAK on this.
>
> jeff
>
Ping.
next prev parent reply other threads:[~2022-09-21 22:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 16:35 [PATCH v1] " Noah Goldstein
2022-06-20 17:29 ` Jakub Jelinek
2022-06-20 17:54 ` H.J. Lu
2022-06-20 18:48 ` Noah Goldstein
2022-06-20 19:04 ` Jakub Jelinek
2022-06-20 19:12 ` Noah Goldstein
2022-06-20 19:57 ` Jakub Jelinek
2022-06-20 20:59 ` Noah Goldstein
2022-06-20 21:42 ` [PATCH v2] " Noah Goldstein
2022-06-21 12:01 ` Jakub Jelinek
2022-06-21 18:13 ` Noah Goldstein
2022-07-07 16:26 ` Noah Goldstein
2022-06-21 18:12 ` [PATCH v3] " Noah Goldstein
2022-07-09 15:59 ` Jeff Law
2022-09-21 22:02 ` Noah Goldstein [this message]
2022-09-22 12:22 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFUsyfLBHJ_Fjh5deSamVa5c=Ua4B9Wj_MPrFfgowbJfDTvrJA@mail.gmail.com' \
--to=goldstein.w.n@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).