Re: [PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-09-22 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 21, 2022 at 11:12:15AM -0700, Noah Goldstein 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 me

Re: [PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-09-21 Thread Noah Goldstein via Gcc-patches
On Sat, Jul 9, 2022 at 8:59 AM Jeff Law via Gcc-patches 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. > > > > Han

Re: [PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-07-09 Thread Jeff Law via Gcc-patches
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

[PATCH v3] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-21 Thread Noah Goldstein via Gcc-patches
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. bo