Re: [PING] [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-04-14 Thread Richard Biener via Gcc-patches
On Tue, Apr 14, 2020 at 11:05 AM xiezhiheng  wrote:
>
> > -Original Message-
> > From: Richard Biener [mailto:richard.guent...@gmail.com]
> > Sent: Tuesday, April 14, 2020 4:39 PM
> > To: xiezhiheng 
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: Re: [PING] [PATCH PR94442] [AArch64] Redundant ldp/stp
> > instructions emitted at -O3
> >
> > On Mon, Apr 13, 2020 at 8:48 AM xiezhiheng 
> > wrote:
> > >
> > > Ping for:
> > > <https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543102.html>
> >
> > This is definitely stage1 material.
>
> OK, thanks for the reply. I was thinking that this is 10 perf regression 
> issue.

Yeah, but we're close to GCC 10 and the actual fix has a broader impact
that just fixing this particular regression - it fundamentally changes where
fwprop propgates to.

> Now let's wait for GCC 11 to solve it.
>
> Xie Zhiheng
>
> >
> > Richard.
> >
> > > Xie Zhiheng
> > >
> > >
>


RE: [PING] [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-04-14 Thread xiezhiheng
> -Original Message-
> From: Richard Biener [mailto:richard.guent...@gmail.com]
> Sent: Tuesday, April 14, 2020 4:39 PM
> To: xiezhiheng 
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PING] [PATCH PR94442] [AArch64] Redundant ldp/stp
> instructions emitted at -O3
> 
> On Mon, Apr 13, 2020 at 8:48 AM xiezhiheng 
> wrote:
> >
> > Ping for:
> > <https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543102.html>
> 
> This is definitely stage1 material.

OK, thanks for the reply. I was thinking that this is 10 perf regression issue.
Now let's wait for GCC 11 to solve it.

Xie Zhiheng

> 
> Richard.
> 
> > Xie Zhiheng
> >
> >



Re: [PING] [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-04-14 Thread Richard Biener via Gcc-patches
On Mon, Apr 13, 2020 at 8:48 AM xiezhiheng  wrote:
>
> Ping for:
> 

This is definitely stage1 material.

Richard.

> Xie Zhiheng
>
>
> > -Original Message-
> > From: xiezhiheng
> > Sent: Thursday, April 2, 2020 2:35 PM
> > To: 'gcc-patches@gcc.gnu.org' 
> > Subject: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted
> > at -O3
> >
> > Hi,
> >   I've created a bug for this issue:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94442
> >
> >   And I'm going to solve this problem by propagating def's insn to its use
> >   when they are at the same loop in fwprop pass.
> >   I mean something like:
> > diff --git a/gcc/fwprop.c b/gcc/fwprop.c
> > index 705d2885aae..0edbbc65047 100644
> > --- a/gcc/fwprop.c
> > +++ b/gcc/fwprop.c
> > @@ -416,7 +416,7 @@ should_replace_address (rtx old_rtx, rtx new_rtx,
> > machine_mode mode,
> >  gain = (set_src_cost (new_rtx, VOIDmode, speed)
> > - set_src_cost (old_rtx, VOIDmode, speed));
> >
> > -  return (gain > 0);
> > +  return (gain >= 0);
> >  }
> >
> >
> > @@ -1573,10 +1573,14 @@ fwprop (bool fwprop_addr_p)
> >df_ref use = DF_USES_GET (i);
> >if (use)
> > {
> > + df_ref def = get_def_for_use (use);
> >   if (DF_REF_TYPE (use) == DF_REF_REG_USE
> >   || DF_REF_BB (use)->loop_father == NULL
> >   /* The outer most loop is not really a loop.  */
> > - || loop_outer (DF_REF_BB (use)->loop_father) == NULL)
> > + || loop_outer (DF_REF_BB (use)->loop_father) == NULL
> > + || (def && (DF_REF_BB (def)->loop_father == DF_REF_BB
> > (use)->loop_father
> > + || flow_loop_nested_p
> > (DF_REF_BB(use)->loop_father,
> > +
> > DF_REF_BB(def)->loop_father
> > forward_propagate_into (use, fwprop_addr_p);
> >
> >   else if (fwprop_addr_p)
> >
> > Any suggestions?
> >
> > Best regards
> > Xie Zhiheng