Re: Propose moving vectorization from -O3 to -O2.

2013-08-27 Thread Richard Biener
On Thu, Aug 22, 2013 at 8:50 AM, Xinliang David Li wrote: >> The effect on runtime is not correlated to >> either (which means the vectorizer cost model is rather bad), but integer >> code usually does not benefit at all. > > The cost model does need some tuning. For instance, GCC vectorizer > doe

Re: Propose moving vectorization from -O3 to -O2.

2013-08-23 Thread Xinliang David Li
On Fri, Aug 23, 2013 at 5:16 AM, Richard Biener wrote: > Xinliang David Li wrote: >>Interesting idea! > > In the past have already arranged for re-use of the epilogue loop and the > scalar loop, so the situation was even worse. > > Note that re-use prevents complete peeling of the epilogue which

Re: Propose moving vectorization from -O3 to -O2.

2013-08-23 Thread Ondřej Bílka
On Fri, Aug 23, 2013 at 02:16:35PM +0200, Richard Biener wrote: > Xinliang David Li wrote: > >Interesting idea! > > In the past have already arranged for re-use of the epilogue loop and the > scalar loop, so the situation was even worse. > > Note that re-use prevents complete peeling of the epi

Re: Propose moving vectorization from -O3 to -O2.

2013-08-23 Thread Richard Biener
Xinliang David Li wrote: >Interesting idea! In the past have already arranged for re-use of the epilogue loop and the scalar loop, so the situation was even worse. Note that re-use prevents complete peeling of the epilogue which is often profitable. Combining the prologue will introduce a mis

Re: Propose moving vectorization from -O3 to -O2.

2013-08-22 Thread Xinliang David Li
Interesting idea! David On Thu, Aug 22, 2013 at 4:46 PM, Cong Hou wrote: > Another opportunity to reduce the code size is combining the scalar version > from loop versioning, the prolog and the epilog of loop peeling. I manually > made the following function for foo(). The running time does not

Re: Propose moving vectorization from -O3 to -O2.

2013-08-22 Thread Xinliang David Li
On Thu, Aug 22, 2013 at 1:24 AM, Ondřej Bílka wrote: > On Wed, Aug 21, 2013 at 11:50:34PM -0700, Xinliang David Li wrote: >> > The effect on runtime is not correlated to >> > either (which means the vectorizer cost model is rather bad), but integer >> > code usually does not benefit at all. >> >>

Re: Propose moving vectorization from -O3 to -O2.

2013-08-22 Thread Ondřej Bílka
On Wed, Aug 21, 2013 at 11:50:34PM -0700, Xinliang David Li wrote: > > The effect on runtime is not correlated to > > either (which means the vectorizer cost model is rather bad), but integer > > code usually does not benefit at all. > > The cost model does need some tuning. For instance, GCC vect

Re: Propose moving vectorization from -O3 to -O2.

2013-08-21 Thread Xinliang David Li
> The effect on runtime is not correlated to > either (which means the vectorizer cost model is rather bad), but integer > code usually does not benefit at all. The cost model does need some tuning. For instance, GCC vectorizer does peeling aggressively, but peeling in many cases can be avoided w

Re: Propose moving vectorization from -O3 to -O2.

2013-08-21 Thread Andi Kleen
One problem I have with the vectorizer on by default is that it enables tree loop unrolling, which sometimes generates quite bloated/weird code and it's unclear if it helps. Would it be possible to only do the unrolling when vectorizing? Also I suspect the trade off on vectorizing is different b

Re: Propose moving vectorization from -O3 to -O2.

2013-08-21 Thread Richard Biener
On Tue, Aug 20, 2013 at 6:38 PM, Xinliang David Li wrote: > On Tue, Aug 20, 2013 at 3:59 AM, Richard Biener > wrote: >> Xinliang David Li wrote: >>>On Mon, Aug 19, 2013 at 11:53 AM, Richard Biener >>> wrote: Xinliang David Li wrote: >+cc auto-vectorizer maintainers. > >David >>

Re: Propose moving vectorization from -O3 to -O2.

2013-08-20 Thread Xinliang David Li
On Tue, Aug 20, 2013 at 3:59 AM, Richard Biener wrote: > Xinliang David Li wrote: >>On Mon, Aug 19, 2013 at 11:53 AM, Richard Biener >> wrote: >>> Xinliang David Li wrote: +cc auto-vectorizer maintainers. David On Mon, Aug 19, 2013 at 10:37 AM, Cong Hou wrote: > Nowada

Re: Propose moving vectorization from -O3 to -O2.

2013-08-20 Thread Richard Biener
Xinliang David Li wrote: >On Mon, Aug 19, 2013 at 11:53 AM, Richard Biener > wrote: >> Xinliang David Li wrote: >>>+cc auto-vectorizer maintainers. >>> >>>David >>> >>>On Mon, Aug 19, 2013 at 10:37 AM, Cong Hou wrote: Nowadays, SIMD instructions play more and more important roles in >our >>

Re: Propose moving vectorization from -O3 to -O2.

2013-08-19 Thread Xinliang David Li
On Mon, Aug 19, 2013 at 11:53 AM, Richard Biener wrote: > Xinliang David Li wrote: >>+cc auto-vectorizer maintainers. >> >>David >> >>On Mon, Aug 19, 2013 at 10:37 AM, Cong Hou wrote: >>> Nowadays, SIMD instructions play more and more important roles in our >>> daily computations. AVX and AVX2 h

Re: Propose moving vectorization from -O3 to -O2.

2013-08-19 Thread Richard Biener
Xinliang David Li wrote: >+cc auto-vectorizer maintainers. > >David > >On Mon, Aug 19, 2013 at 10:37 AM, Cong Hou wrote: >> Nowadays, SIMD instructions play more and more important roles in our >> daily computations. AVX and AVX2 have extended 128-bit registers to >> 256-bit ones, and the newly a

Re: Propose moving vectorization from -O3 to -O2.

2013-08-19 Thread Xinliang David Li
+cc auto-vectorizer maintainers. David On Mon, Aug 19, 2013 at 10:37 AM, Cong Hou wrote: > Nowadays, SIMD instructions play more and more important roles in our > daily computations. AVX and AVX2 have extended 128-bit registers to > 256-bit ones, and the newly announced AVX-512 further doubles t