This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [autovect] [patch] enchance vectorizer for ivs after loop


Hello,

> > on loops like
> > 
> > for (i = 0; i < 64; i++)
> >   {
> >     x = 10 * i + 5;
> >     A[i] = B[i];
> >   }
> > 
> > use (x);
> > 
> > vectorizer should optimize to
> > 
> > A[0:63] = B[0:63];
> > use (635);
> > 
> > but the vectorizer gives up since number of iterations should be changed
> > but
> > value of x must be preserved. This patch enhances vectorizer to perform
> > this
> > optimization and adds some testcases for this new feature.
> 
> scev_const_prop should already do this optimization (calculate the final
> value of x and replace use(x) with it), and thus, you should only need
> to run it before vectorization.

and actually, scev_const_prop is run before vectorizer, optimizes out x,
and the loop is successfully vectorized, for all the proposed testcases.
So I somewhat miss the point of the patch.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]