This is the mail archive of the gcc@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]

Re: Loop optimiser upgrade (Was RFC: BB duplication code)


> Jan Hubicka writes:
>  > What do you think about restructuring it to kind of "loop library"
>  > as I've mentioned previously?
>  > 
>  > As we already have code to discover loops, I would love to see everything
>  > designed in similar way - ie function to create preheaders/landing pads,
>  > function to discover invariants, function to discover BIVs and implement each
>  > optimization as separate pass.
> 
> Yes, I agree.  Each of these modules should be decoupled as much as
> possible to simplify the maintenance.
> 
> Maybe we should try the unthinkable and have a go at designing the
> interfaces first ;-)
Hmm, this still sounds temping. Perhaps we can try to sumarize what
we want to accomplish at RTL level.  I following optimizations are IMO thinkable:

1) code hoisting/invariant code motion - this should be obsoletted by PRE/load/store motion
2) strength reduction
3) "prefetch" instruction genration and probably dropping the "nontemporal" hints to loads too
4) loop peeling
5) loop unrolling+preconditioning+variable expansion
6) induction variable removal - this should be obsoleted by proper dead code elimination
7) Something else?

About 4) - I already do have code that is able to peel loop based on the
bb-reorder pass.  Problem is that the representation a bit differs there
from the normal insn stream, as the CFG contains disjunt basic block and
the fallthru edges may point anywhere. This makes duplicating the basic
blocks very convenient, but I am not quite sure if it will work well with
rest of loop infrastructure.

Also the header duplication can be seen as special case of loop peeling.
There is still problem how to keep the "VTOP" infromation around..

About 5) - that one should be done IMO as the peeling is - just by duplicating.
How much do we want to integrate it with scheduling and software pipelining?
Also needs it to be done together with preconditioning?

I do have the code to turn pseudos into webs that, in combination with CSE,
should replace the variable expansion done by current unroller.

Honza
> 
> Michael.


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