Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-13 Thread Jeff Law via Gcc-patches
On Fri, 2020-03-13 at 09:09 +0100, Christophe Lyon wrote: > Hi, > > > On Thu, 12 Mar 2020 at 23:12, Jeff Law via Gcc-patches > wrote: > > On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > > > On Thu, Mar 12, 2020 at 12:03:08PM -0600, Jeff Law wrote: > > > > On Sat, 2020-02-08 at 10:

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-13 Thread Richard Sandiford
Jeff, thanks for picking this up. Jeff Law writes: > On Thu, 2020-03-12 at 15:26 -0500, Segher Boessenkool wrote: >> On Thu, Mar 12, 2020 at 12:47:04PM -0600, Jeff Law wrote: >> > On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: >> > > > else if (n_sets == 1 >> > > > -

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-13 Thread Christophe Lyon via Gcc-patches
Hi, On Thu, 12 Mar 2020 at 23:12, Jeff Law via Gcc-patches wrote: > > On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > > On Thu, Mar 12, 2020 at 12:03:08PM -0600, Jeff Law wrote: > > > On Sat, 2020-02-08 at 10:41 -0600, Segher Boessenkool wrote: > > > > I don't think each stanza of

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Jeff Law via Gcc-patches
On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > On Thu, Mar 12, 2020 at 12:03:08PM -0600, Jeff Law wrote: > > On Sat, 2020-02-08 at 10:41 -0600, Segher Boessenkool wrote: > > > I don't think each stanza of code should use it's own "noop-ness", no. > > Richard's patch is actually bett

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Jeff Law via Gcc-patches
On Thu, 2020-03-12 at 15:26 -0500, Segher Boessenkool wrote: > On Thu, Mar 12, 2020 at 12:47:04PM -0600, Jeff Law wrote: > > On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > > > > else if (n_sets == 1 > > > > - && MEM_P (trial) > > > > + &&

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Segher Boessenkool
On Thu, Mar 12, 2020 at 12:47:04PM -0600, Jeff Law wrote: > On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > > > else if (n_sets == 1 > > > -&& MEM_P (trial) > > > +&& ! CALL_P (insn) > > > +&& (MEM_P (trial) || REG_P (trial)) > > >

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Jeff Law via Gcc-patches
On Thu, 2020-03-12 at 13:23 -0500, Segher Boessenkool wrote: > > > > I don't know if this patch makes matters worse or not. It doesn't seem > > > suitable for stage 4 though. And Richard said the cse.c part breaks > > > rs6000, if that is true, yes I do object ;-) > > The rs6000 port breakage is

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Segher Boessenkool
On Thu, Mar 12, 2020 at 12:03:08PM -0600, Jeff Law wrote: > On Sat, 2020-02-08 at 10:41 -0600, Segher Boessenkool wrote: > > I don't think each stanza of code should use it's own "noop-ness", no. > Richard's patch is actually better than mine in that regard as it handles mem > and > reg nop moves

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-03-12 Thread Jeff Law via Gcc-patches
On Sat, 2020-02-08 at 10:41 -0600, Segher Boessenkool wrote: > On Fri, Feb 07, 2020 at 09:00:40AM -0700, Jeff Law wrote: > > On Thu, 2020-02-06 at 07:56 -0600, Segher Boessenkool wrote: > > > On Wed, Feb 05, 2020 at 11:48:23AM -0700, Jeff Law wrote: > > > > Yea, it's closely related. In your case

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-08 Thread Segher Boessenkool
On Fri, Feb 07, 2020 at 09:00:40AM -0700, Jeff Law wrote: > On Thu, 2020-02-06 at 07:56 -0600, Segher Boessenkool wrote: > > On Wed, Feb 05, 2020 at 11:48:23AM -0700, Jeff Law wrote: > > > Yea, it's closely related. In your case you need to effectively ignore > > > the nop insn to get the optimiza

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-07 Thread Jeff Law
On Thu, 2020-02-06 at 07:56 -0600, Segher Boessenkool wrote: > On Wed, Feb 05, 2020 at 11:48:23AM -0700, Jeff Law wrote: > > Yea, it's closely related. In your case you need to effectively ignore > > the nop insn to get the optimization you want. In mine that nop insn > > causes an ICE. > > > >

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-06 Thread Segher Boessenkool
On Wed, Feb 05, 2020 at 11:48:23AM -0700, Jeff Law wrote: > Yea, it's closely related. In your case you need to effectively ignore > the nop insn to get the optimization you want. In mine that nop insn > causes an ICE. > > I think we could take your cse bits + adding a !CALL_P separately from >

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-06 Thread Jeff Law
On Wed, 2020-02-05 at 13:30 +, Richard Sandiford wrote: > Jeff Law writes: > > Richard & Segher, if y'all could check my analysis here, it'd be > > appreciated. > > > > pr90275 is a P2 regression that is only triggering on ARM. David's > > testcase in c#1 is the best for this problem as it d

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-05 Thread Richard Sandiford
Jeff Law writes: > Richard & Segher, if y'all could check my analysis here, it'd be > appreciated. > > pr90275 is a P2 regression that is only triggering on ARM. David's > testcase in c#1 is the best for this problem as it doesn't require > magic flags like -fno-dce to trigger. > > The block in q

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-05 Thread Segher Boessenkool
Hi all, On Wed, Feb 05, 2020 at 07:26:03AM +0100, Jakub Jelinek wrote: > On Tue, Feb 04, 2020 at 06:04:09PM -0700, Jeff Law wrote: > > --- a/gcc/cse.c > > +++ b/gcc/cse.c > > @@ -5572,6 +5572,16 @@ cse_insn (rtx_insn *insn) > > sets[i].rtl = 0; > > } > > > > + /* Similarly for no-

Re: [RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-04 Thread Jakub Jelinek
On Tue, Feb 04, 2020 at 06:04:09PM -0700, Jeff Law wrote: > --- a/gcc/cse.c > +++ b/gcc/cse.c > @@ -5572,6 +5572,16 @@ cse_insn (rtx_insn *insn) > sets[i].rtl = 0; > } > > + /* Similarly for no-op moves. */ > + if (n_sets == 1 > + && GET_CODE (src) == REG Just nits

[RFA] [PR rtl-optimization/90275] Handle nop reg->reg copies in cse

2020-02-04 Thread Jeff Law
Richard & Segher, if y'all could check my analysis here, it'd be appreciated. pr90275 is a P2 regression that is only triggering on ARM. David's testcase in c#1 is the best for this problem as it doesn't require magic flags like -fno-dce to trigger. The block in question: > (code_label 89 88 9