Re: VEC_COND_EXPR optimizations v2

2020-08-07 Thread Richard Biener via Gcc-patches
On Fri, Aug 7, 2020 at 2:15 PM Marc Glisse wrote: > > On Fri, 7 Aug 2020, Richard Biener wrote: > > > On Fri, Aug 7, 2020 at 10:33 AM Marc Glisse wrote: > >> > >> On Fri, 7 Aug 2020, Richard Biener wrote: > >> > >>> On Thu, Aug 6, 2020 at 8:07 PM Marc Glisse wrote: > > On Thu, 6 Aug 20

Re: VEC_COND_EXPR optimizations v2

2020-08-07 Thread Marc Glisse
On Fri, 7 Aug 2020, Richard Biener wrote: On Fri, Aug 7, 2020 at 10:33 AM Marc Glisse wrote: On Fri, 7 Aug 2020, Richard Biener wrote: On Thu, Aug 6, 2020 at 8:07 PM Marc Glisse wrote: On Thu, 6 Aug 2020, Christophe Lyon wrote: Was I on the right track configuring with --target=arm-non

Re: VEC_COND_EXPR optimizations v2

2020-08-07 Thread Richard Biener via Gcc-patches
On Fri, Aug 7, 2020 at 10:33 AM Marc Glisse wrote: > > On Fri, 7 Aug 2020, Richard Biener wrote: > > > On Thu, Aug 6, 2020 at 8:07 PM Marc Glisse wrote: > >> > >> On Thu, 6 Aug 2020, Christophe Lyon wrote: > >> > Was I on the right track configuring with > --target=arm-none-linux-gnueab

Re: VEC_COND_EXPR optimizations v2

2020-08-07 Thread Marc Glisse
On Fri, 7 Aug 2020, Richard Biener wrote: On Thu, Aug 6, 2020 at 8:07 PM Marc Glisse wrote: On Thu, 6 Aug 2020, Christophe Lyon wrote: Was I on the right track configuring with --target=arm-none-linux-gnueabihf --with-cpu=cortex-a9 --with-fpu=neon-fp16 then compiling without any special opt

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Richard Biener via Gcc-patches
On Thu, Aug 6, 2020 at 8:07 PM Marc Glisse wrote: > > On Thu, 6 Aug 2020, Christophe Lyon wrote: > > >> Was I on the right track configuring with > >> --target=arm-none-linux-gnueabihf --with-cpu=cortex-a9 > >> --with-fpu=neon-fp16 > >> then compiling without any special option? > > > > Maybe you

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Marc Glisse
On Thu, 6 Aug 2020, Christophe Lyon wrote: Was I on the right track configuring with --target=arm-none-linux-gnueabihf --with-cpu=cortex-a9 --with-fpu=neon-fp16 then compiling without any special option? Maybe you also need --with-float=hard, I don't remember if it's implied by the 'hf' target

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Christophe Lyon via Gcc-patches
On Thu, 6 Aug 2020 at 13:42, Marc Glisse wrote: > > On Thu, 6 Aug 2020, Christophe Lyon wrote: > > > On Thu, 6 Aug 2020 at 11:06, Marc Glisse wrote: > >> > >> On Thu, 6 Aug 2020, Christophe Lyon wrote: > >> > > 2020-08-05 Marc Glisse > > > > PR tree-optimization/95906 > >>>

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Marc Glisse
On Thu, 6 Aug 2020, Christophe Lyon wrote: On Thu, 6 Aug 2020 at 11:06, Marc Glisse wrote: On Thu, 6 Aug 2020, Christophe Lyon wrote: 2020-08-05 Marc Glisse PR tree-optimization/95906 PR target/70314 * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e),

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Christophe Lyon via Gcc-patches
On Thu, 6 Aug 2020 at 11:06, Marc Glisse wrote: > > On Thu, 6 Aug 2020, Christophe Lyon wrote: > > >>> 2020-08-05 Marc Glisse > >>> > >>> PR tree-optimization/95906 > >>> PR target/70314 > >>> * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e), > >>> (v ? w

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Marc Glisse
On Thu, 6 Aug 2020, Richard Biener wrote: On Thu, Aug 6, 2020 at 10:17 AM Christophe Lyon wrote: Hi, On Wed, 5 Aug 2020 at 16:24, Richard Biener via Gcc-patches wrote: On Wed, Aug 5, 2020 at 3:33 PM Marc Glisse wrote: New version that passed bootstrap+regtest during the night. When v

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Richard Biener via Gcc-patches
On Thu, Aug 6, 2020 at 10:17 AM Christophe Lyon wrote: > > Hi, > > > On Wed, 5 Aug 2020 at 16:24, Richard Biener via Gcc-patches > wrote: > > > > On Wed, Aug 5, 2020 at 3:33 PM Marc Glisse wrote: > > > > > > New version that passed bootstrap+regtest during the night. > > > > > > When vector comp

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Marc Glisse
On Thu, 6 Aug 2020, Christophe Lyon wrote: 2020-08-05 Marc Glisse PR tree-optimization/95906 PR target/70314 * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e), (v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): New transformations. (op (c ? a : b)): Upd

Re: VEC_COND_EXPR optimizations v2

2020-08-06 Thread Christophe Lyon via Gcc-patches
Hi, On Wed, 5 Aug 2020 at 16:24, Richard Biener via Gcc-patches wrote: > > On Wed, Aug 5, 2020 at 3:33 PM Marc Glisse wrote: > > > > New version that passed bootstrap+regtest during the night. > > > > When vector comparisons were forced to use vec_cond_expr, we lost a number > > of > > optimiz

Re: VEC_COND_EXPR optimizations v2

2020-08-05 Thread Richard Biener via Gcc-patches
On Wed, Aug 5, 2020 at 3:33 PM Marc Glisse wrote: > > New version that passed bootstrap+regtest during the night. > > When vector comparisons were forced to use vec_cond_expr, we lost a number of > optimizations (my fault for not adding enough testcases to prevent that). > This patch tries to unwr

VEC_COND_EXPR optimizations v2

2020-08-05 Thread Marc Glisse
New version that passed bootstrap+regtest during the night. When vector comparisons were forced to use vec_cond_expr, we lost a number of optimizations (my fault for not adding enough testcases to prevent that). This patch tries to unwrap vec_cond_expr a bit so some optimizations can still hap

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Marc Glisse
On Fri, 31 Jul 2020, Marc Glisse wrote: On Fri, 31 Jul 2020, Richard Sandiford wrote: Marc Glisse writes: On Fri, 31 Jul 2020, Richard Sandiford wrote: Marc Glisse writes: +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ + (simplify + (op (vec_cond:s @0 @1 @2) (vec_cond:s

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Marc Glisse
On Fri, 31 Jul 2020, Richard Sandiford wrote: Marc Glisse writes: On Fri, 31 Jul 2020, Richard Sandiford wrote: Marc Glisse writes: +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ + (simplify + (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) + (with + { + tree rhs1

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Fri, Jul 31, 2020 at 2:50 PM Richard Sandiford wrote: > > Marc Glisse writes: > > On Fri, 31 Jul 2020, Richard Sandiford wrote: > > > >> Marc Glisse writes: > >>> +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ > >>> + (simplify > >>> + (op (vec_cond:s @0 @1 @2) (vec_cond:s @

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Sandiford
Marc Glisse writes: > On Fri, 31 Jul 2020, Richard Sandiford wrote: > >> Marc Glisse writes: >>> +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ >>> + (simplify >>> + (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) >>> + (with >>> + { >>> + tree rhs1, rhs2 = NULL; >>> +

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Marc Glisse
On Fri, 31 Jul 2020, Richard Biener wrote: On Fri, Jul 31, 2020 at 1:39 PM Richard Biener wrote: On Fri, Jul 31, 2020 at 1:35 PM Richard Biener wrote: On Thu, Jul 30, 2020 at 9:49 AM Marc Glisse wrote: When vector comparisons were forced to use vec_cond_expr, we lost a number of optimiz

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Fri, Jul 31, 2020 at 1:47 PM Richard Biener wrote: > > On Fri, Jul 31, 2020 at 1:39 PM Richard Biener > wrote: > > > > On Fri, Jul 31, 2020 at 1:35 PM Richard Biener > > wrote: > > > > > > On Thu, Jul 30, 2020 at 9:49 AM Marc Glisse wrote: > > > > > > > > When vector comparisons were forced

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Marc Glisse
On Fri, 31 Jul 2020, Richard Biener wrote: +/* (v ? w : 0) ? a : b is just (v & w) ? a : b */ +(simplify + (vec_cond (vec_cond:s @0 @3 integer_zerop) @1 @2) + (vec_cond (bit_and @0 @3) @1 @2)) Does something check automatically that @0 and @3 have compatible types? @0 should always have a v

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Fri, Jul 31, 2020 at 1:39 PM Richard Biener wrote: > > On Fri, Jul 31, 2020 at 1:35 PM Richard Biener > wrote: > > > > On Thu, Jul 30, 2020 at 9:49 AM Marc Glisse wrote: > > > > > > When vector comparisons were forced to use vec_cond_expr, we lost a number > > > of optimizations (my fault for

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Fri, Jul 31, 2020 at 1:39 PM Marc Glisse wrote: > > On Fri, 31 Jul 2020, Richard Sandiford wrote: > > > Marc Glisse writes: > >> +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ > >> + (simplify > >> + (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) > >> + (with > >> + { >

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Fri, Jul 31, 2020 at 1:35 PM Richard Biener wrote: > > On Thu, Jul 30, 2020 at 9:49 AM Marc Glisse wrote: > > > > When vector comparisons were forced to use vec_cond_expr, we lost a number > > of optimizations (my fault for not adding enough testcases to prevent > > that). This patch tries to

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Marc Glisse
On Fri, 31 Jul 2020, Richard Sandiford wrote: Marc Glisse writes: +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ + (simplify + (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) + (with + { + tree rhs1, rhs2 = NULL; + rhs1 = fold_binary (op, type, @1, @3); + if (

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Biener via Gcc-patches
On Thu, Jul 30, 2020 at 9:49 AM Marc Glisse wrote: > > When vector comparisons were forced to use vec_cond_expr, we lost a number > of optimizations (my fault for not adding enough testcases to prevent > that). This patch tries to unwrap vec_cond_expr a bit so some > optimizations can still happen

Re: VEC_COND_EXPR optimizations

2020-07-31 Thread Richard Sandiford
Marc Glisse writes: > +/* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ > + (simplify > + (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) > + (with > + { > + tree rhs1, rhs2 = NULL; > + rhs1 = fold_binary (op, type, @1, @3); > + if (rhs1 && is_gimple_val (rhs1)) > +

VEC_COND_EXPR optimizations

2020-07-30 Thread Marc Glisse
When vector comparisons were forced to use vec_cond_expr, we lost a number of optimizations (my fault for not adding enough testcases to prevent that). This patch tries to unwrap vec_cond_expr a bit so some optimizations can still happen. I wasn't planning to add all those transformations toge