This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C,C++,Ada,Java,F77] opt/5076 and opt/2847
- From: Jan Hubicka <jh at suse dot cz>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Sat, 9 Feb 2002 18:59:56 +0100
- Subject: Re: [C,C++,Ada,Java,F77] opt/5076 and opt/2847
- References: <20020129205634.A8596@redhat.com>
>
> A complete rewrite of loop to use the cfg and to ignore
> all loop notes would indeed fix the problem, but that's
> not exactly practical at this stage.
>
> So who mucked up the loop note in the first place? Some
> grotty loop rotation code in expand_end_loop. This stuff
> is so bad I don't see how to fix it reliably at all.
>
> The first hunk is completely redundant with the jump optimizer.
> I cropped this bit out of the compiler and couldn't find a single
> case in which we differed at all by the time .03.jump was run.
> So this is a complete no-brainer to remove.
Sorry for jumping in late, but I've been on the vacation. My belief that the
loop rotation code has purpose to manage the conditional to be last insn in the
loop. The loop optimizer generally expects this. When loop has counter, but it
is not being last condition, it fails to figure out the number of iterations
and fails to unroll.
I used to have patch to change unrolled to grok that cases but it was so ugly
that I've never submited it. For 3.2, I hope we will end up with using
Zdenek's new unrolling code, but for 3.1, I think we need to manage the
rotation of loops to happen.
I will take a look at this issue closer tomorrow.
Honza