Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-22 Thread Jeff Law via Gcc-patches
On 9/21/2021 6:54 AM, Roger Sayle wrote: That define_insn is making my eyes bleed! I think that's the most convincing argument I've ever read on gcc-patches, and I can see now what Segher is so opposed to. Then you haven't seen enough patterns or your eyes haven't toughened up through the

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-22 Thread Jeff Law via Gcc-patches
On 9/21/2021 6:01 AM, Richard Sandiford via Gcc-patches wrote: [Using this is a convenient place to reply to the thread as a whole] Richard Biener via Gcc-patches writes: On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool wrote: On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle

RE: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Roger Sayle
: Segher Boessenkool ; Richard Biener ; Roger Sayle Subject: Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE [Using this is a convenient place to reply to the thread as a whole] Richard Biener via Gcc-patches writes: > On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool > w

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Segher Boessenkool
On Tue, Sep 21, 2021 at 08:24:04AM +0200, Richard Biener wrote: > On Tue, Sep 21, 2021 at 6:18 AM Jeff Law via Gcc-patches > wrote: > > If we were catching the scenario which led to the creation of (subreg > > (truncate)) in combine and instead of creating (subreg (truncate)) we > > instead

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Segher Boessenkool
On Mon, Sep 20, 2021 at 10:18:15PM -0600, Jeff Law wrote: > On 9/20/2021 6:23 PM, Segher Boessenkool wrote: > >There is no such thing as "earlier than simplify-rtx", that is the > >point. simplify-rtx is not a pass: it is like a library that is used > >from all over the RTL routines. > I'm

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Richard Sandiford via Gcc-patches
[Using this is a convenient place to reply to the thread as a whole] Richard Biener via Gcc-patches writes: > On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool > wrote: >> >> On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle wrote: >> > This patch simplifies the RTX (subreg:HI (truncate:QI

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Richard Biener via Gcc-patches
On Tue, Sep 21, 2021 at 6:18 AM Jeff Law via Gcc-patches wrote: > > > > On 9/20/2021 6:23 PM, Segher Boessenkool wrote: > > Hi! > > > > On Sun, Sep 19, 2021 at 09:14:55AM -0600, Jeff Law wrote: > >> On 9/6/2021 8:24 AM, Segher Boessenkool wrote: > >>> On Mon, Sep 06, 2021 at 12:32:13PM +0100,

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-20 Thread Jeff Law via Gcc-patches
On 9/20/2021 6:23 PM, Segher Boessenkool wrote: Hi! On Sun, Sep 19, 2021 at 09:14:55AM -0600, Jeff Law wrote: On 9/6/2021 8:24 AM, Segher Boessenkool wrote: On Mon, Sep 06, 2021 at 12:32:13PM +0100, Roger Sayle wrote: I think the current documentation is sufficient. During compilation,

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-20 Thread Segher Boessenkool
Hi! On Sun, Sep 19, 2021 at 09:14:55AM -0600, Jeff Law wrote: > On 9/6/2021 8:24 AM, Segher Boessenkool wrote: > >On Mon, Sep 06, 2021 at 12:32:13PM +0100, Roger Sayle wrote: > >>I think the current documentation is sufficient. During compilation, > >>GCC's > >>combine pass will often

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-19 Thread Jeff Law via Gcc-patches
On 9/6/2021 8:24 AM, Segher Boessenkool wrote: Hi! On Mon, Sep 06, 2021 at 12:32:13PM +0100, Roger Sayle wrote: I think the current documentation is sufficient. During compilation, GCC's combine pass will often substitute a register with an expression defining it's value, and then attempt

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-06 Thread Segher Boessenkool
Hi! On Mon, Sep 06, 2021 at 12:32:13PM +0100, Roger Sayle wrote: > I think the current documentation is sufficient. During compilation, GCC's > combine pass will often substitute a register with an expression defining > it's value, and then attempt to simplify it. As you point out, this often >

RE: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-06 Thread Roger Sayle
you think. Best regards, Roger -- -Original Message- From: Segher Boessenkool Sent: 06 September 2021 11:14 To: Roger Sayle Cc: 'GCC Patches' Subject: Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle wrote: >

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-06 Thread Richard Biener via Gcc-patches
On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool wrote: > > On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle wrote: > > This patch simplifies the RTX (subreg:HI (truncate:QI (reg:SI))) as > > (truncate:HI (reg:SI)), and closely related variants. > > Subregs of other than regs are undefined

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-06 Thread Segher Boessenkool
On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle wrote: > This patch simplifies the RTX (subreg:HI (truncate:QI (reg:SI))) as > (truncate:HI (reg:SI)), and closely related variants. Subregs of other than regs are undefined in RTL. You will first have to define this (in documentation as well

[PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-05 Thread Roger Sayle
This patch simplifies the RTX (subreg:HI (truncate:QI (reg:SI))) as (truncate:HI (reg:SI)), and closely related variants. In RTL, a paradoxical SUBREG where the outermode is wider than the innermode is like the extensions zero_extend or sign_extend, but where we don't care about the contents of