Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Richard Biener
On Mon, 9 Jan 2017, Jakub Jelinek wrote: > On Mon, Jan 09, 2017 at 11:08:08AM +0100, Richard Biener wrote: > > > > > There is one thing my patch doesn't do but should for efficiency, if > > > > > loop1 > > > > > (outer loop) is not successfully outer-loop vectorized, then we > > > > > should mar

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Jakub Jelinek
On Mon, Jan 09, 2017 at 11:08:08AM +0100, Richard Biener wrote: > > > > There is one thing my patch doesn't do but should for efficiency, if > > > > loop1 > > > > (outer loop) is not successfully outer-loop vectorized, then we should > > > > mark > > > > loop2 (its inner loop) as dont_vectorize i

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Richard Biener
On Mon, 9 Jan 2017, Jakub Jelinek wrote: > On Mon, Jan 09, 2017 at 10:08:24AM +0100, Richard Biener wrote: > > > if if-conversion thinks outer loop vectorization might be successful. > > > In this case, loop2 is if-converted. This works well if the outer loop > > > versioning is subsequently succ

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Jakub Jelinek
On Mon, Jan 09, 2017 at 10:08:24AM +0100, Richard Biener wrote: > > if if-conversion thinks outer loop vectorization might be successful. > > In this case, loop2 is if-converted. This works well if the outer loop > > versioning is subsequently successful, doesn't work at all if it is > > unsuccess

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Richard Biener
On Mon, 9 Jan 2017, Jakub Jelinek wrote: > On Sat, Jan 07, 2017 at 12:46:26PM +0100, Richard Biener wrote: > > >The following patch tweaks tree-if-conv.c so that when it wants to > > >version > > >an outer loop, it actually transforms: > > > loop1 > > > loop2 > > >into: > > >

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-09 Thread Jakub Jelinek
On Sat, Jan 07, 2017 at 12:46:26PM +0100, Richard Biener wrote: > >The following patch tweaks tree-if-conv.c so that when it wants to > >version > >an outer loop, it actually transforms: > > loop1 > > loop2 > >into: > > if (LOOP_VECTORIZED (1, 3)) > > { >

Re: [PATCH] Outer vs. inner loop ifcvt (PR tree-optimization/78899)

2017-01-07 Thread Richard Biener
On January 6, 2017 7:56:10 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >If-conversion can't easily predict whether outer loop vectorization >will be >successful or not. In GCC 6, we'd version and guard with >LOOP_VECTORIZED >only the inner loop, which is beneficial if the outer loop >vectorization