This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Changes to enable peeling non-innermost loops
Hello,
>
> On Fri, 10 Nov 2006, Zdenek Dvorak wrote:
> >
> > * cfgloopmanip.c (update_single_exit_for_duplicated_loop,
> > update_single_exit_for_duplicated_loops): New functions.
> > (duplicate_loop_to_header_edge): Use
> > update_single_exit_for_duplicated_loops.
> > * tree-ssa-loop-manip.c (tree_unroll_loop): Call verification
> > functions only with ENABLE_CHECKING.
>
> This is OK for mainline.
>
> Any plans of generalize this code further so that irreducible loops
> can be made reducible by peeling them?
no. As far as I am aware, this is rarely profitable. Irreducible loops
are not too common. In cases when they appear frequently (like
lexical analysers etc.), the loops created by transforming the
irreducible loops are not succeptible to common loop optimizations
(perhaps with the exception of invariant motion).
Anyway, code to eliminate the irreducible loops could not use the current
loop manipulation functions directly, as we assume that the loops have
just one header on too many places. The easiest way how to implement
this would be either using the functions from tree-ssa-threadupdate,
or possibly tree_duplicate_sese_region.
Zdenek