Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-24 Thread Uros Bizjak
On Thu, Nov 21, 2013 at 11:37 AM, Jakub Jelinek wrote: > On Thu, Nov 21, 2013 at 07:43:35AM +1000, Richard Henderson wrote: >> On 11/20/2013 07:44 PM, Jakub Jelinek wrote: >> > On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: >> >> Aww ;) Nice improvement. Generally when I see thi

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-21 Thread Jakub Jelinek
On Thu, Nov 21, 2013 at 12:37:01PM +0100, Richard Biener wrote: > Oh, indeed. Bah. That case makes the whole stuff quadratic, too ;) True, O(nelts^2), but largest nelts we have right now is 64 (V64QImode on -mavx512f). > For > > typedef int vLARGEsi __attribute__((vector_size(1024*1024))); Th

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-21 Thread Richard Biener
On Thu, 21 Nov 2013, Jakub Jelinek wrote: > On Thu, Nov 21, 2013 at 12:18:45PM +0100, Richard Biener wrote: > > > Bootstrap/regtest pending, ok at least for this for the start and can be > > > improved later on? > > > > Ok, this should catch most of the vectorizer cases. > > > > Zero could also

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-21 Thread Jakub Jelinek
On Thu, Nov 21, 2013 at 12:18:45PM +0100, Richard Biener wrote: > > Bootstrap/regtest pending, ok at least for this for the start and can be > > improved later on? > > Ok, this should catch most of the vectorizer cases. > > Zero could also be handled for PLUS_EXPR, likewise one for MULT_EXPR. > I

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-21 Thread Richard Biener
On Thu, 21 Nov 2013, Jakub Jelinek wrote: > On Thu, Nov 21, 2013 at 07:43:35AM +1000, Richard Henderson wrote: > > On 11/20/2013 07:44 PM, Jakub Jelinek wrote: > > > On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: > > >> Aww ;) Nice improvement. Generally when I see this I always

[PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion (take 2)

2013-11-21 Thread Jakub Jelinek
On Thu, Nov 21, 2013 at 07:43:35AM +1000, Richard Henderson wrote: > On 11/20/2013 07:44 PM, Jakub Jelinek wrote: > > On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: > >> Aww ;) Nice improvement. Generally when I see this I always wonder > >> whether we want to do this kind of stu

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion

2013-11-20 Thread Richard Henderson
On 11/20/2013 07:44 PM, Jakub Jelinek wrote: > On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: >> Aww ;) Nice improvement. Generally when I see this I always wonder >> whether we want to do this kind of stuff pre RTL expansion. >> 1st to not rely on being able to TER, 2nd to final

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion

2013-11-20 Thread Richard Biener
On Wed, 20 Nov 2013, Jakub Jelinek wrote: > On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: > > Aww ;) Nice improvement. Generally when I see this I always wonder > > whether we want to do this kind of stuff pre RTL expansion. > > 1st to not rely on being able to TER, 2nd to fina

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion

2013-11-20 Thread Jakub Jelinek
On Wed, Nov 20, 2013 at 10:31:38AM +0100, Richard Biener wrote: > Aww ;) Nice improvement. Generally when I see this I always wonder > whether we want to do this kind of stuff pre RTL expansion. > 1st to not rely on being able to TER, 2nd to finally eventually > get rid of TER. > > These patches

Re: [PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion

2013-11-20 Thread Richard Biener
On Wed, 20 Nov 2013, Jakub Jelinek wrote: > Hi! > > I've noticed we generate terrible code for the testcase below. > E.g. with -mavx2 it is: > leal6(%rdi), %edx > leal12(%rdi), %ecx > leal18(%rdi), %esi > leal3(%rdi), %eax > movl%edx, -2

[PATCH] Improve { x, x + 3, x + 6, x + 9 } expansion

2013-11-20 Thread Jakub Jelinek
Hi! I've noticed we generate terrible code for the testcase below. E.g. with -mavx2 it is: leal6(%rdi), %edx leal12(%rdi), %ecx leal18(%rdi), %esi leal3(%rdi), %eax movl%edx, -20(%rsp) movl%ecx, -24(%rsp) leal9(%rd