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: [C,C++,Ada,Java,F77] opt/5076 and opt/2847


> 
> 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


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