Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Eric Botcazou
> I successfully regtested the attached trivial patch on x86_64-linux-gnu: > > 2013-03-16 Marc Glisse > > * simplify-rtx.c (simplify_binary_operation_1) : > Restrict the transformation to equal modes. OK for 4.9 and 4.8.1 if you add a comment line about the restriction. -- Eric

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Marc Glisse
On Sat, 16 Mar 2013, Eric Botcazou wrote: My current understanding of simplify-rtx is that we should only do "safe" optimizations in it (make sure we only create expressions that every target will recognize), and if I want more advanced optimizations, I should do them elsewhere (not sure where).

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Eric Botcazou
> My current understanding of simplify-rtx is that we should only do "safe" > optimizations in it (make sure we only create expressions that every > target will recognize), and if I want more advanced optimizations, I > should do them elsewhere (not sure where). So I should probably at least > rest

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-15 Thread Marc Glisse
On Sun, 30 Sep 2012, Marc Glisse wrote: On Sat, 29 Sep 2012, Eric Botcazou wrote: this patch lets the compiler try to rewrite: (vec_concat (vec_select x [a]) (vec_select x [b])) as: vec_select x [a b] or even just "x" if appropriate. [...] Why not generalizing to all kinds of VEC_SELECTs

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-10-01 Thread Eric Botcazou
> > /* Try to merge 2 VEC_SELECTs from the same vector into a single one. */ > > I was trying to avoid splitting in 2 lines, but ok I'll split. Indeed. Then you can remove the '2' above, it doesn't add much. -- Eric Botcazou

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-10-01 Thread Marc Glisse
On Mon, 1 Oct 2012, Eric Botcazou wrote: 2012-09-09 Marc Glisse gcc/ * simplify-rtx.c (simplify_binary_operation_1) : Detect the identity. : Handle VEC_SELECTs from the same vector. gcc/testsuite/ * gcc.target/i386/vect-rebuild.c: New testcase. OK if you ad

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-10-01 Thread Eric Botcazou
> 2012-09-09 Marc Glisse > > gcc/ > * simplify-rtx.c (simplify_binary_operation_1) : > Detect the identity. > : Handle VEC_SELECTs from the same vector. > > gcc/testsuite/ > * gcc.target/i386/vect-rebuild.c: New testcase. OK if you adjust the above date and add the mis

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-09-30 Thread Marc Glisse
On Sat, 29 Sep 2012, Eric Botcazou wrote: this patch lets the compiler try to rewrite: (vec_concat (vec_select x [a]) (vec_select x [b])) as: vec_select x [a b] or even just "x" if appropriate. [...] OK, but: 1) Always add a comment describing the simplification when you add one, 2) The

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-09-29 Thread Eric Botcazou
> this patch lets the compiler try to rewrite: > > (vec_concat (vec_select x [a]) (vec_select x [b])) > > as: > > vec_select x [a b] > > or even just "x" if appropriate. > > In a first iteration I was restricting it to b-a==1, but it seemed better > not to: it helps for {v[1],v[0]} and doesn't

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-09-26 Thread Marc Glisse
Hello, RTL optimizers looks like a promising category, and Eric like a nice maintainer for it, adding in Cc: ;-) (I bothered Richard Sandiford last time) On Tue, 11 Sep 2012, Marc Glisse wrote: On Sun, 9 Sep 2012, Marc Glisse wrote: Hello, this patch lets the compiler try to rewrite: (v

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2012-09-11 Thread Marc Glisse
On Sun, 9 Sep 2012, Marc Glisse wrote: Hello, this patch lets the compiler try to rewrite: (vec_concat (vec_select x [a]) (vec_select x [b])) as: vec_select x [a b] or even just "x" if appropriate. In a first iteration I was restricting it to b-a==1, but it seemed better not to: it helps