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: Daniel Berlin <dberlin at dberlin dot org>
- To: Victor Kaplansky <VICTORK at il dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Dorit Nuzman <DORIT at il dot ibm dot com>
- Date: Wed, 08 Feb 2006 15:20:35 -0500
- Subject: Re: [autovect] [patch] enchance vectorizer for ivs after loop
- References: <OF12F0BE98.FDEA9A61-ONC225710F.006CB592-C225710F.006D4D77@il.ibm.com>
On Wed, 2006-02-08 at 21:53 +0200, Victor Kaplansky wrote:
>
>
>
> 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.