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


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.



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