[lno] copy header and vectorization

Richard Henderson rth@redhat.com
Wed Feb 18 05:29:00 GMT 2004


On Tue, Feb 17, 2004 at 08:15:26PM -0800, Devang Patel wrote:
>   for (i = 0; i < N; i++){
>     a[i] = i;
>   }
[...]
> <bb 0>:
>   i_2 = 0;
>   a[i_2] = i_2;
>   i_15 = i_2 + 1;
>   if (i_15 <= 15) goto <L0>; else goto <L9>;
> 
>   # i_1 = PHI <i_15(0), i_18(1)>;
> <L0>:;
>   a[i_1] = i_1;
>   i_18 = i_1 + 1;
>   if (i_18 <= 15) goto <L0>; else goto <L9>;

Indeed, I would assert that the loop header copy phase is broken for
this case.  There is absolutely no reason to copy anything for a loop
known to be executed at least once.



r~



More information about the Gcc mailing list