Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-16 Thread H.J. Lu
On Mon, Jan 13, 2014 at 5:37 AM, Richard Biener wrote: > On Wed, 27 Nov 2013, Jakub Jelinek wrote: > >> On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: >> > Hmm. I'm still thinking that we should handle this during the regular >> > transform step. >> >> I wonder if it can't be don

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-14 Thread Richard Biener
On Tue, 14 Jan 2014, Jakub Jelinek wrote: > On Tue, Jan 14, 2014 at 10:01:06AM +0100, Richard Biener wrote: > > Jakub, adding the new flag is ok with me. > > So like this? Ok if it passes testing. Thanks, Richard. > 2014-01-14 Jakub Jelinek > > * tree-vectorizer.h (struct _loop_vec_i

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-14 Thread Jakub Jelinek
On Tue, Jan 14, 2014 at 10:01:06AM +0100, Richard Biener wrote: > Jakub, adding the new flag is ok with me. So like this? 2014-01-14 Jakub Jelinek * tree-vectorizer.h (struct _loop_vec_info): Add no_data_dependencies field. (LOOP_VINFO_NO_DATA_DEPENDENCIES): Define.

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-14 Thread Richard Biener
On Tue, 14 Jan 2014, Richard Biener wrote: > On Mon, 13 Jan 2014, Cong Hou wrote: > > > I noticed that LIM could not hoist vector invariant, and that is why > > my first implementation tries to hoist them all. > > Yes, I filed PR59786 for this. I'll see if I can come up with > a fix suitable fo

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-14 Thread Richard Biener
On Mon, 13 Jan 2014, Cong Hou wrote: > I noticed that LIM could not hoist vector invariant, and that is why > my first implementation tries to hoist them all. Yes, I filed PR59786 for this. I'll see if I can come up with a fix suitable for stage3. > In addition, there are two disadvantages of h

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-13 Thread Cong Hou
I noticed that LIM could not hoist vector invariant, and that is why my first implementation tries to hoist them all. In addition, there are two disadvantages of hoisting invariant load + lim method: First, for some instructions the scalar version is faster than the vector version, and in this ca

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-13 Thread Jakub Jelinek
On Mon, Jan 13, 2014 at 02:37:38PM +0100, Richard Biener wrote: > 2014-01-13 Richard Biener > > PR tree-optimization/58921 > PR tree-optimization/59006 > * tree-vect-loop-manip.c (vect_loop_versioning): Remove code > hoisting invariant stmts. > * tree-vect-stmts.c

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-13 Thread Richard Biener
On Wed, 27 Nov 2013, Jakub Jelinek wrote: > On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: > > Hmm. I'm still thinking that we should handle this during the regular > > transform step. > > I wonder if it can't be done instead just in vectorizable_load, > if LOOP_REQUIRES_VERSION

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Cong Hou
On Wed, Nov 27, 2013 at 1:53 AM, Richard Biener wrote: > On Fri, 22 Nov 2013, Cong Hou wrote: > >> Hi >> >> Currently in GCC vectorization, some loop invariant may be detected >> after aliasing checks, which can be hoisted outside of the loop. The >> current method in GCC may break the information

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Richard Biener
On Wed, 27 Nov 2013, Jakub Jelinek wrote: > On Wed, Nov 27, 2013 at 12:54:14PM +0100, Richard Biener wrote: > > On Wed, 27 Nov 2013, Jakub Jelinek wrote: > > > > > On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: > > > > Hmm. I'm still thinking that we should handle this during th

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Jakub Jelinek
On Wed, Nov 27, 2013 at 12:54:14PM +0100, Richard Biener wrote: > On Wed, 27 Nov 2013, Jakub Jelinek wrote: > > > On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: > > > Hmm. I'm still thinking that we should handle this during the regular > > > transform step. > > > > I wonder if

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Richard Biener
On Wed, 27 Nov 2013, Jakub Jelinek wrote: > On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: > > Hmm. I'm still thinking that we should handle this during the regular > > transform step. > > I wonder if it can't be done instead just in vectorizable_load, > if LOOP_REQUIRES_VERSION

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Jakub Jelinek
On Wed, Nov 27, 2013 at 10:53:56AM +0100, Richard Biener wrote: > Hmm. I'm still thinking that we should handle this during the regular > transform step. I wonder if it can't be done instead just in vectorizable_load, if LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo) and the load is invariant, j

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Richard Biener
On Fri, 22 Nov 2013, Cong Hou wrote: > Hi > > Currently in GCC vectorization, some loop invariant may be detected > after aliasing checks, which can be hoisted outside of the loop. The > current method in GCC may break the information built during the > analysis phase, causing some crash (see PR5

[PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-22 Thread Cong Hou
Hi Currently in GCC vectorization, some loop invariant may be detected after aliasing checks, which can be hoisted outside of the loop. The current method in GCC may break the information built during the analysis phase, causing some crash (see PR59006 and PR58921). This patch improves the loop i