This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] copy header and vectorization
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Devang Patel <dpatel at apple dot com>,"gcc at gcc dot gnu dot org list" <gcc at gcc dot gnu dot org>
- Date: Wed, 18 Feb 2004 19:47:43 +0100
- Subject: Re: [lno] copy header and vectorization
- References: <20040218052928.GA3882@redhat.com>
Hello,
> 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.
I agree; the "problem" here is that jump threading already did the work
here, and loop header copying then (for small loops) does just
peeling the first iteration. I will post a patch for this later today.
Zdenek