From: Jeff Law <jeffreyalaw@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr
Date: Sat, 9 Jul 2022 09:59:35 -0600 [thread overview]
Message-ID: <74183249-3937-af58-207f-ec41333384d2@gmail.com> (raw)
In-Reply-To: <20220621181215.2942551-1-goldstein.w.n@gmail.com>
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
next prev parent reply other threads:[~2022-07-09 15:59 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 [this message]
2022-09-21 22:02 ` Noah Goldstein
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=74183249-3937-af58-207f-ec41333384d2@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/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).