Re: [RFC] ldist: Recognize rawmemchr loop patterns

2022-01-31 Thread Richard Biener via Gcc-patches
On Mon, Jan 31, 2022 at 2:16 PM Tom de Vries wrote: > > On 9/17/21 10:08, Richard Biener via Gcc-patches wrote: > > On Mon, Sep 13, 2021 at 4:53 PM Stefan Schulze Frielinghaus > > wrote: > >> > >> On Mon, Sep 06, 2021 at 11:56:21AM +0200, Richard Biener wrote: > >>> On Fri, Sep 3, 2021 at 10:01 A

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2022-01-31 Thread Tom de Vries via Gcc-patches
On 9/17/21 10:08, Richard Biener via Gcc-patches wrote: On Mon, Sep 13, 2021 at 4:53 PM Stefan Schulze Frielinghaus wrote: On Mon, Sep 06, 2021 at 11:56:21AM +0200, Richard Biener wrote: On Fri, Sep 3, 2021 at 10:01 AM Stefan Schulze Frielinghaus wrote: On Fri, Aug 20, 2021 at 12:35:58PM +

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-10-11 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Fri, Sep 17, 2021 at 10:08:27AM +0200, Richard Biener wrote: > On Mon, Sep 13, 2021 at 4:53 PM Stefan Schulze Frielinghaus > wrote: > > > > On Mon, Sep 06, 2021 at 11:56:21AM +0200, Richard Biener wrote: > > > On Fri, Sep 3, 2021 at 10:01 AM Stefan Schulze Frielinghaus > > > wrote: > > > > > >

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-09-17 Thread Richard Biener via Gcc-patches
On Mon, Sep 13, 2021 at 4:53 PM Stefan Schulze Frielinghaus wrote: > > On Mon, Sep 06, 2021 at 11:56:21AM +0200, Richard Biener wrote: > > On Fri, Sep 3, 2021 at 10:01 AM Stefan Schulze Frielinghaus > > wrote: > > > > > > On Fri, Aug 20, 2021 at 12:35:58PM +0200, Richard Biener wrote: > > > [...]

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-09-13 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Mon, Sep 06, 2021 at 11:56:21AM +0200, Richard Biener wrote: > On Fri, Sep 3, 2021 at 10:01 AM Stefan Schulze Frielinghaus > wrote: > > > > On Fri, Aug 20, 2021 at 12:35:58PM +0200, Richard Biener wrote: > > [...] > > > > > > > > > > + /* Handle strlen like loops. */ > > > > > + if (store_dr

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-09-06 Thread Richard Biener via Gcc-patches
On Fri, Sep 3, 2021 at 10:01 AM Stefan Schulze Frielinghaus wrote: > > On Fri, Aug 20, 2021 at 12:35:58PM +0200, Richard Biener wrote: > [...] > > > > > > > > + /* Handle strlen like loops. */ > > > > + if (store_dr == NULL > > > > + && integer_zerop (pattern) > > > > + && TREE_CODE (

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-09-03 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Fri, Aug 20, 2021 at 12:35:58PM +0200, Richard Biener wrote: [...] > > > > > > + /* Handle strlen like loops. */ > > > + if (store_dr == NULL > > > + && integer_zerop (pattern) > > > + && TREE_CODE (reduction_iv.base) == INTEGER_CST > > > + && TREE_CODE (reduction_iv.step) == I

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-08-20 Thread Richard Biener via Gcc-patches
On Fri, Jun 25, 2021 at 12:23 PM Stefan Schulze Frielinghaus wrote: > > On Wed, Jun 16, 2021 at 04:22:35PM +0200, Richard Biener wrote: > > On Mon, Jun 14, 2021 at 7:26 PM Stefan Schulze Frielinghaus > > wrote: > > > > > > On Thu, May 20, 2021 at 08:37:24PM +0200, Stefan Schulze Frielinghaus > >

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-08-06 Thread Stefan Schulze Frielinghaus via Gcc-patches
ping On Fri, Jun 25, 2021 at 12:23:32PM +0200, Stefan Schulze Frielinghaus wrote: > On Wed, Jun 16, 2021 at 04:22:35PM +0200, Richard Biener wrote: > > On Mon, Jun 14, 2021 at 7:26 PM Stefan Schulze Frielinghaus > > wrote: > > > > > > On Thu, May 20, 2021 at 08:37:24PM +0200, Stefan Schulze Friel

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-06-25 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Wed, Jun 16, 2021 at 04:22:35PM +0200, Richard Biener wrote: > On Mon, Jun 14, 2021 at 7:26 PM Stefan Schulze Frielinghaus > wrote: > > > > On Thu, May 20, 2021 at 08:37:24PM +0200, Stefan Schulze Frielinghaus wrote: > > [...] > > > > but we won't ever arrive here because of the niters conditio

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-06-16 Thread Richard Biener via Gcc-patches
On Mon, Jun 14, 2021 at 7:26 PM Stefan Schulze Frielinghaus wrote: > > On Thu, May 20, 2021 at 08:37:24PM +0200, Stefan Schulze Frielinghaus wrote: > [...] > > > but we won't ever arrive here because of the niters condition. But > > > yes, doing the pattern matching in the innermost loop processi

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-06-14 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Thu, May 20, 2021 at 08:37:24PM +0200, Stefan Schulze Frielinghaus wrote: [...] > > but we won't ever arrive here because of the niters condition. But > > yes, doing the pattern matching in the innermost loop processing code > > looks good to me - for the specific case it would be > > > >

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-20 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Thu, May 20, 2021 at 11:24:57AM +0200, Richard Biener wrote: > On Fri, May 7, 2021 at 2:32 PM Stefan Schulze Frielinghaus > wrote: > > > > On Wed, May 05, 2021 at 11:36:41AM +0200, Richard Biener wrote: > > > On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus > > > wrote: > > > > > >

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-20 Thread Richard Biener via Gcc-patches
On Fri, May 7, 2021 at 2:32 PM Stefan Schulze Frielinghaus wrote: > > On Wed, May 05, 2021 at 11:36:41AM +0200, Richard Biener wrote: > > On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus > > wrote: > > > > > > [snip] > > > > > > Please find attached a new version of the patch. A major

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-07 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Wed, May 05, 2021 at 11:36:41AM +0200, Richard Biener wrote: > On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus > wrote: > > > > [snip] > > > > Please find attached a new version of the patch. A major change compared to > > the previous patch is that I created a separate pass which

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-05 Thread Richard Biener via Gcc-patches
On Wed, May 5, 2021 at 11:36 AM Richard Biener wrote: > > On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus > wrote: > > > > [snip] > > > > Please find attached a new version of the patch. A major change compared to > > the previous patch is that I created a separate pass which hopeful

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-05 Thread Richard Biener via Gcc-patches
On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus wrote: > > [snip] > > Please find attached a new version of the patch. A major change compared to > the previous patch is that I created a separate pass which hopefully makes > reviewing also easier since it is almost self-contained. Af

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-04 Thread Stefan Schulze Frielinghaus via Gcc-patches
ping On Thu, Apr 08, 2021 at 10:23:31AM +0200, Stefan Schulze Frielinghaus wrote: > ping > > On Tue, Mar 16, 2021 at 06:13:21PM +0100, Stefan Schulze Frielinghaus wrote: > > [snip] > > > > Please find attached a new version of the patch. A major change compared to > > the previous patch is that

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-04-08 Thread Stefan Schulze Frielinghaus via Gcc-patches
ping On Tue, Mar 16, 2021 at 06:13:21PM +0100, Stefan Schulze Frielinghaus wrote: > [snip] > > Please find attached a new version of the patch. A major change compared to > the previous patch is that I created a separate pass which hopefully makes > reviewing also easier since it is almost self-

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-03-16 Thread Stefan Schulze Frielinghaus via Gcc-patches
[snip] Please find attached a new version of the patch. A major change compared to the previous patch is that I created a separate pass which hopefully makes reviewing also easier since it is almost self-contained. After realizing that detecting loops which mimic the behavior of rawmemchr/strlen

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-03-03 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Tue, Mar 02, 2021 at 01:29:59PM +0100, Richard Biener wrote: > On Sun, Feb 14, 2021 at 11:27 AM Stefan Schulze Frielinghaus > wrote: > > > > On Tue, Feb 09, 2021 at 09:57:58AM +0100, Richard Biener wrote: > > > On Mon, Feb 8, 2021 at 3:11 PM Stefan Schulze Frielinghaus via > > > Gcc-patches wr

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-03-02 Thread Richard Biener via Gcc-patches
On Sun, Feb 14, 2021 at 11:27 AM Stefan Schulze Frielinghaus wrote: > > On Tue, Feb 09, 2021 at 09:57:58AM +0100, Richard Biener wrote: > > On Mon, Feb 8, 2021 at 3:11 PM Stefan Schulze Frielinghaus via > > Gcc-patches wrote: > > > > > > This patch adds support for recognizing loops which mimic t

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-02-25 Thread Jeff Law via Gcc-patches
On 2/25/21 10:01 AM, Stefan Schulze Frielinghaus via Gcc-patches wrote: > Ping Given this is not a regression it needs to wait for gcc-12. jeff

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-02-25 Thread Stefan Schulze Frielinghaus via Gcc-patches
Ping On Sun, Feb 14, 2021 at 11:27:40AM +0100, Stefan Schulze Frielinghaus wrote: > On Tue, Feb 09, 2021 at 09:57:58AM +0100, Richard Biener wrote: > > On Mon, Feb 8, 2021 at 3:11 PM Stefan Schulze Frielinghaus via > > Gcc-patches wrote: > > > > > > This patch adds support for recognizing loops w

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-02-14 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Tue, Feb 09, 2021 at 09:57:58AM +0100, Richard Biener wrote: > On Mon, Feb 8, 2021 at 3:11 PM Stefan Schulze Frielinghaus via > Gcc-patches wrote: > > > > This patch adds support for recognizing loops which mimic the behaviour > > of function rawmemchr, and replaces those with an internal funct

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-02-09 Thread Richard Biener via Gcc-patches
On Mon, Feb 8, 2021 at 3:11 PM Stefan Schulze Frielinghaus via Gcc-patches wrote: > > This patch adds support for recognizing loops which mimic the behaviour > of function rawmemchr, and replaces those with an internal function call > in case a target provides them. In contrast to the original ra

[RFC] ldist: Recognize rawmemchr loop patterns

2021-02-08 Thread Stefan Schulze Frielinghaus via Gcc-patches
This patch adds support for recognizing loops which mimic the behaviour of function rawmemchr, and replaces those with an internal function call in case a target provides them. In contrast to the original rawmemchr function, this patch also supports different instances where the memory pointed to