Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-21 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 22, 2020 at 12:36 AM Segher Boessenkool wrote: > > On Wed, Oct 21, 2020 at 04:43:29PM +0100, Richard Sandiford wrote: > > Hongtao Liu writes: > > > + poly_uint64 nunits > > > + = GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0))); > > > + rtx par = trueop1; >

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-21 Thread Segher Boessenkool
On Wed, Oct 21, 2020 at 04:43:29PM +0100, Richard Sandiford wrote: > Hongtao Liu writes: > > + poly_uint64 nunits > > + = GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0))); > > + rtx par = trueop1; > > + for (int i = 0; i != l1; i++) > > + { > > +

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-21 Thread Richard Sandiford via Gcc-patches
Hongtao Liu writes: > + poly_uint64 nunits > + = GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0))); > + rtx par = trueop1; > + for (int i = 0; i != l1; i++) > + { > + rtx idx = XVECEXP (trueop1, 0, i); > + if

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-20 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 21, 2020 at 5:07 AM Segher Boessenkool wrote: > > On Tue, Oct 20, 2020 at 11:20:48AM +0800, Hongtao Liu wrote: > > + unsigned HOST_WIDE_INT subreg_offset = 0; > > + if (GET_CODE (trueop0) == SUBREG > > + && GET_MODE_INNER (mode) > > + ==

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-20 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 21, 2020 at 12:42 AM Richard Sandiford wrote: > > Hongtao Liu writes: > >> > + && (GET_MODE_NUNITS (mode)).is_constant () > >> > + && (GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0 > >> > + .is_constant () > >> > + && known_le (l1, l2)

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-20 Thread Segher Boessenkool
On Tue, Oct 20, 2020 at 11:20:48AM +0800, Hongtao Liu wrote: > + unsigned HOST_WIDE_INT subreg_offset = 0; > + if (GET_CODE (trueop0) == SUBREG > + && GET_MODE_INNER (mode) > + == GET_MODE_INNER (GET_MODE (SUBREG_REG (trueop0))) > + && (GET_MODE_NUNITS

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-20 Thread Segher Boessenkool
On Thu, Oct 15, 2020 at 04:14:39PM +0800, Hongtao Liu wrote: > On Thu, Oct 15, 2020 at 1:37 AM Segher Boessenkool > wrote: > > > + gcc_assert (can_div_trunc_p (SUBREG_BYTE (trueop0), > > > +GET_MODE_SIZE (GET_MODE_INNER > > > (mode)), > > > +

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-20 Thread Richard Sandiford via Gcc-patches
Hongtao Liu writes: >> > + && (GET_MODE_NUNITS (mode)).is_constant () >> > + && (GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0 >> > + .is_constant () >> > + && known_le (l1, l2) >> >> I'm not sure the last two & are really the important condition.

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 11:31 PM Richard Sandiford wrote: > > Hongtao Liu writes: > > On Thu, Oct 15, 2020 at 8:38 PM Richard Sandiford > > wrote: > >> > >> Hongtao Liu via Gcc-patches writes: > >> > + /* Simplify vec_select of a subreg of X to just a vec_select of X > >> > +

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-19 Thread Richard Sandiford via Gcc-patches
Hongtao Liu writes: > On Thu, Oct 15, 2020 at 8:38 PM Richard Sandiford > wrote: >> >> Hongtao Liu via Gcc-patches writes: >> > + /* Simplify vec_select of a subreg of X to just a vec_select of X >> > + when X has same component mode as vec_select. */ >> > + int l2; >> > +

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-18 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 15, 2020 at 8:38 PM Richard Sandiford wrote: > > Hongtao Liu via Gcc-patches writes: > > + /* Simplify vec_select of a subreg of X to just a vec_select of X > > + when X has same component mode as vec_select. */ > > + int l2; > > + if (GET_CODE (trueop0)

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-15 Thread Richard Sandiford via Gcc-patches
Hongtao Liu via Gcc-patches writes: > + /* Simplify vec_select of a subreg of X to just a vec_select of X > + when X has same component mode as vec_select. */ > + int l2; > + if (GET_CODE (trueop0) == SUBREG > + && GET_MODE_INNER (mode) > + ==

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-15 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 15, 2020 at 4:14 PM Hongtao Liu wrote: > > On Thu, Oct 15, 2020 at 1:37 AM Segher Boessenkool > wrote: > > > > Hi! > > > > On Wed, Oct 14, 2020 at 01:43:45PM +0800, Hongtao Liu wrote: > > > On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool > > > wrote: > > > > On Tue, Oct 13, 2020

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-15 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 15, 2020 at 1:37 AM Segher Boessenkool wrote: > > Hi! > > On Wed, Oct 14, 2020 at 01:43:45PM +0800, Hongtao Liu wrote: > > On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool > > wrote: > > > On Tue, Oct 13, 2020 at 04:40:53PM +0800, Hongtao Liu wrote: > > > > For rtx like > > > >

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-14 Thread Segher Boessenkool
On Wed, Oct 14, 2020 at 07:55:55PM +0200, Richard Biener wrote: > On October 14, 2020 7:35:32 PM GMT+02:00, Segher Boessenkool > wrote: > >On Wed, Oct 14, 2020 at 01:43:45PM +0800, Hongtao Liu wrote: > >> On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool > >> wrote: > >> > On Tue, Oct 13, 2020

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-14 Thread Richard Biener via Gcc-patches
On October 14, 2020 7:35:32 PM GMT+02:00, Segher Boessenkool wrote: >Hi! > >On Wed, Oct 14, 2020 at 01:43:45PM +0800, Hongtao Liu wrote: >> On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool >> wrote: >> > On Tue, Oct 13, 2020 at 04:40:53PM +0800, Hongtao Liu wrote: >> > > For rtx like >> > >

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-14 Thread Segher Boessenkool
Hi! On Wed, Oct 14, 2020 at 01:43:45PM +0800, Hongtao Liu wrote: > On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool > wrote: > > On Tue, Oct 13, 2020 at 04:40:53PM +0800, Hongtao Liu wrote: > > > For rtx like > > > (vec_select:V2SI (subreg:V4SI (inner:V2SI) 0) > > >

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-13 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 14, 2020 at 4:01 AM Segher Boessenkool wrote: > > Hi! > > On Tue, Oct 13, 2020 at 04:40:53PM +0800, Hongtao Liu wrote: > > For rtx like > > (vec_select:V2SI (subreg:V4SI (inner:V2SI) 0) > >(parallel [(const_int 0) (const_int 1)])) > > it could be simplified as

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-13 Thread Segher Boessenkool
Hi! On Tue, Oct 13, 2020 at 04:40:53PM +0800, Hongtao Liu wrote: > For rtx like > (vec_select:V2SI (subreg:V4SI (inner:V2SI) 0) >(parallel [(const_int 0) (const_int 1)])) > it could be simplified as inner. You could even simplify any vec_select of a subreg of X to just a