This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [autovect] [patch] enchance vectorizer for ivs after loop
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Victor Kaplansky <VICTORK at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org, Dorit Nuzman <DORIT at il dot ibm dot com>
- Date: Thu, 9 Feb 2006 08:25:02 +0100
- Subject: Re: [autovect] [patch] enchance vectorizer for ivs after loop
- References: <1139430035.25833.67.camel@linux.site>
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