Re: New GCC options for loop vectorization

2013-09-24 Thread Richard Biener
On Mon, Sep 23, 2013 at 10:37 PM, Xinliang David Li wrote: > Thanks. I modified the patch so that the max allowed peel iterations > can be specified via a parameter. Testing on going. Ok for trunk ? +DEFPARAM(PARAM_VECT_MAX_PEELING_FOR_ALIGNMENT, + "vect-max-peeling-for-alignment", +

Re: New GCC options for loop vectorization

2013-09-23 Thread Xinliang David Li
Thanks. I modified the patch so that the max allowed peel iterations can be specified via a parameter. Testing on going. Ok for trunk ? David On Mon, Sep 23, 2013 at 4:31 AM, Richard Biener wrote: > On Wed, Sep 18, 2013 at 10:21 PM, Xinliang David Li > wrote: >> On Tue, Sep 17, 2013 at 1:20 AM

Re: New GCC options for loop vectorization

2013-09-23 Thread Richard Biener
On Wed, Sep 18, 2013 at 10:21 PM, Xinliang David Li wrote: > On Tue, Sep 17, 2013 at 1:20 AM, Richard Biener > wrote: >> On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li >> wrote: >>> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >>> wrote: On Fri, Sep 13, 2013 at 5:16 PM, Xinliang D

Re: New GCC options for loop vectorization

2013-09-18 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 1:20 AM, Richard Biener wrote: > On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li > wrote: >> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >> wrote: >>> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >>> wrote: On Fri, Sep 13, 2013 at 1:30 AM, Richard Bi

Re: New GCC options for loop vectorization

2013-09-17 Thread Jakub Jelinek
On Tue, Sep 17, 2013 at 08:37:57AM -0700, Xinliang David Li wrote: > >> char a[1]; > >> > >> void foo(int n) > >> { > >> int* b = (int*)(a+n); > >> int i = 0; > >> for (; i < 1000; ++i) > >> b[i] = 1; > >> } > >> > >> int main(int argn, char** argv) > >> { > >> foo(argn); > >> } > >

Re: New GCC options for loop vectorization

2013-09-17 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 8:45 AM, Jakub Jelinek wrote: > On Tue, Sep 17, 2013 at 08:37:57AM -0700, Xinliang David Li wrote: >> >> char a[1]; >> >> >> >> void foo(int n) >> >> { >> >> int* b = (int*)(a+n); >> >> int i = 0; >> >> for (; i < 1000; ++i) >> >> b[i] = 1; >> >> } >> >> >> >>

Re: New GCC options for loop vectorization

2013-09-17 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 1:20 AM, Richard Biener wrote: > On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li > wrote: >> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >> wrote: >>> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >>> wrote: On Fri, Sep 13, 2013 at 1:30 AM, Richard Bi

Re: New GCC options for loop vectorization

2013-09-17 Thread Richard Biener
On Tue, Sep 17, 2013 at 10:20 AM, Richard Biener wrote: > On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li > wrote: >> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >> wrote: >>> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >>> wrote: On Fri, Sep 13, 2013 at 1:30 AM, Richard B

Re: New GCC options for loop vectorization

2013-09-17 Thread Richard Biener
On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li wrote: > On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener > wrote: >> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >> wrote: >>> On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener >>> wrote: On Thu, Sep 12, 2013 at 10:31 PM, Xinliang D

Re: New GCC options for loop vectorization

2013-09-16 Thread Xinliang David Li
On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener wrote: > On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li wrote: >> On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener >> wrote: >>> On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li >>> wrote: Currently -ftree-vectorize turns on both loop

Re: New GCC options for loop vectorization

2013-09-16 Thread Xinliang David Li
I incorporated all the comments and committed the change (also fixed a test failure with --help=optimizers). thanks, David On Mon, Sep 16, 2013 at 3:07 AM, Richard Biener wrote: > On Fri, Sep 13, 2013 at 6:56 PM, Xinliang David Li wrote: >> Updated patch implementing the logic that more specif

Re: New GCC options for loop vectorization

2013-09-16 Thread Jakub Jelinek
On Mon, Sep 16, 2013 at 12:07:37PM +0200, Richard Biener wrote: > On Fri, Sep 13, 2013 at 6:56 PM, Xinliang David Li wrote: > > Updated patch implementing the logic that more specific option wins. > > > > Ok for trunk? > > @@ -2305,8 +2305,8 @@ omp_max_vf (void) > { >if (!optimize >|

Re: New GCC options for loop vectorization

2013-09-16 Thread Richard Biener
On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li wrote: > On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener > wrote: >> On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li >> wrote: >>> Currently -ftree-vectorize turns on both loop and slp vectorizations, >>> but there is no simple way to turn

Re: New GCC options for loop vectorization

2013-09-16 Thread Richard Biener
On Fri, Sep 13, 2013 at 6:56 PM, Xinliang David Li wrote: > Updated patch implementing the logic that more specific option wins. > > Ok for trunk? @@ -2305,8 +2305,8 @@ omp_max_vf (void) { if (!optimize || optimize_debug - || (!flag_tree_vectorize - && global_options_set.x_flag_t

Re: New GCC options for loop vectorization

2013-09-16 Thread Richard Biener
On Fri, Sep 13, 2013 at 6:45 PM, Joseph S. Myers wrote: > On Fri, 13 Sep 2013, Richard Biener wrote: > >> @@ -1691,6 +1695,12 @@ common_handle_option (struct gcc_options >> opts->x_flag_ipa_reference = false; >>break; >> >> +case OPT_ftree_vectorize: >> + if (!opts_set->x

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
Updated patch implementing the logic that more specific option wins. Ok for trunk? thanks, David On Fri, Sep 13, 2013 at 9:48 AM, Xinliang David Li wrote: > Ok -- then my updated patch is wrong then. The implementation in the > first version matches the requirement. > > thanks, > > David > > >

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
Ok -- then my updated patch is wrong then. The implementation in the first version matches the requirement. thanks, David On Fri, Sep 13, 2013 at 9:45 AM, Joseph S. Myers wrote: > On Fri, 13 Sep 2013, Richard Biener wrote: > >> @@ -1691,6 +1695,12 @@ common_handle_option (struct gcc_options >>

Re: New GCC options for loop vectorization

2013-09-13 Thread Joseph S. Myers
On Fri, 13 Sep 2013, Richard Biener wrote: > @@ -1691,6 +1695,12 @@ common_handle_option (struct gcc_options > opts->x_flag_ipa_reference = false; >break; > > +case OPT_ftree_vectorize: > + if (!opts_set->x_flag_tree_loop_vectorize) > + opts->x_flag_tree_loop_vectorize =

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
New patch attached. 1) the peeling part is removed 2) the new patch implements the last-one-wins logic. -ftree-vectorize behaves like a true alias. -fno-tree-vectorize can override previous -ftree-xxx-vectorize. Ok for trunk after testing? thanks, David On Fri, Sep 13, 2013 at 8:16 AM, Xinlian

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener wrote: > On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li > wrote: >> Currently -ftree-vectorize turns on both loop and slp vectorizations, >> but there is no simple way to turn on loop vectorization alone. The >> logic for default O3 setting is

Re: New GCC options for loop vectorization

2013-09-13 Thread Richard Biener
On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li wrote: > Currently -ftree-vectorize turns on both loop and slp vectorizations, > but there is no simple way to turn on loop vectorization alone. The > logic for default O3 setting is also complicated. > > In this patch, two new options are introd