Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-08 Thread Jan Hubicka
> On Sat, Oct 6, 2012 at 11:34 AM, Jan Hubicka wrote: > > Hi, > > I benchmarked the patch moving loop header copying and it is quite > > noticeable win. > > > > Some testsuite updating is needed. In many cases it is just because the > > optimizations are now happening earlier. > > There are howev

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-08 Thread Richard Guenther
On Sat, Oct 6, 2012 at 11:34 AM, Jan Hubicka wrote: > Hi, > I benchmarked the patch moving loop header copying and it is quite noticeable > win. > > Some testsuite updating is needed. In many cases it is just because the > optimizations are now happening earlier. > There are however few testusite

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-06 Thread Jan Hubicka
Hi, I benchmarked the patch moving loop header copying and it is quite noticeable win. Some testsuite updating is needed. In many cases it is just because the optimizations are now happening earlier. There are however few testusite failures I have torubles to deal with: ./testsuite/gcc/gcc.sum:FA

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-05 Thread Jan Hubicka
Hi, this is the udpated patch I comitted after testing. I suppose we will need to find way to make SOC smaller for simple loops - it is way too overestimated currently. * tree-vectorizer.h (vect_estimate_min_profitable_iters): Remove. * tree-vect-loop.c (vect_estimate_min_profita

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-04 Thread Richard Guenther
On Thu, 4 Oct 2012, Jan Hubicka wrote: > > > So SOC cancels out in the runtime check. > > > I still think we need two formulas - one determining if vectorization is > > > profitable, other specifying the threshold for scalar path at runtime > > > (that > > > will generally give lower values). > >

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-04 Thread Jan Hubicka
> > So SOC cancels out in the runtime check. > > I still think we need two formulas - one determining if vectorization is > > profitable, other specifying the threshold for scalar path at runtime (that > > will generally give lower values). > > True, we want two values. But part of the scalar pat

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-02 Thread Richard Guenther
On Mon, 1 Oct 2012, Jan Hubicka wrote: > > > > > > So the unvectorized cost is > > > SIC * niters > > > > > > The vectorized path is > > > SOC + VIC * ((niters-PL_ITERS-EP_ITERS)/VF) + VOC > > > The scalar path of vectorizer loop is > > > SIC * niters + SOC > > > >

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-01 Thread Jan Hubicka
> > > > So the unvectorized cost is > > SIC * niters > > > > The vectorized path is > > SOC + VIC * ((niters-PL_ITERS-EP_ITERS)/VF) + VOC > > The scalar path of vectorizer loop is > > SIC * niters + SOC > > Note that 'th' is used for the runtime profitability check

Re: [RFC] Make vectorizer to skip loops with small iteration estimate

2012-10-01 Thread Richard Guenther
On Sun, 30 Sep 2012, Jan Hubicka wrote: > Hi, > the point of the following patch is to make vectorizer to not vectorize the > following testcase with profile feedback: > > int a[1]; > int i=5; > int k=2; > int val; > __attribute__ ((noinline,noclone)) > test() > { > int j; > for(j

[RFC] Make vectorizer to skip loops with small iteration estimate

2012-09-30 Thread Jan Hubicka
Hi, the point of the following patch is to make vectorizer to not vectorize the following testcase with profile feedback: int a[1]; int i=5; int k=2; int val; __attribute__ ((noinline,noclone)) test() { int j; for(j=0;j VIC * ((niters-PL_ITERS-EP_ITERS)/VF) + VOC(A) where