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
s also a common practice in other compilers: >>>>>> >>>>>> 1) Intel's ICC turns on vectorizer at O2 by default and it has been >>>>>> the case for many years; >>>>>> >>>>>> 2) Most recently, LLVM tu

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

2013-08-20 Thread Xinliang David Li
d the newly announced AVX-512 further doubles the >>>>> size. The benefit we can get from vectorization will be larger and >>>>> larger. This is also a common practice in other compilers: >>>>> >>>>> 1) Intel's ICC turns on vectorizer a

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

2013-08-20 Thread Richard Biener
tion will be larger and >>>> larger. This is also a common practice in other compilers: >>>> >>>> 1) Intel's ICC turns on vectorizer at O2 by default and it has been >>>> the case for many years; >>>> >>>> 2) Most recentl

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

2013-08-19 Thread Xinliang David Li
n other compilers: >>> >>> 1) Intel's ICC turns on vectorizer at O2 by default and it has been >>> the case for many years; >>> >>> 2) Most recently, LLVM turns it on for both O2 and Os. >>> >>> >>> Here we propose moving

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

2013-08-19 Thread Richard Biener
been >> the case for many years; >> >> 2) Most recently, LLVM turns it on for both O2 and Os. >> >> >> Here we propose moving vectorization from -O3 to -O2 in GCC. Three >> main concerns about this change are: 1. Does vectorization greatly >> increas

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

2013-08-19 Thread Xinliang David Li
LLVM turns it on for both O2 and Os. > > > Here we propose moving vectorization from -O3 to -O2 in GCC. Three > main concerns about this change are: 1. Does vectorization greatly > increase the generated code size? 2. How much performance can be > improved? 3. Does vectorization increas