This is the mail archive of the 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: tree-vectorizer.c splitup

Richard Henderson <> wrote on 02/02/2005 00:25:12:

> On Mon, Jan 31, 2005 at 07:27:36PM +0200, Dorit Naishlos wrote:
> > tree-simple-loop-utils.c: loop-peeling utilities (non vectorizer
> How does this relate to tree-ssa-loop-ch.c?  It looks like you've
> got duplicate code in here...

The vectorizer operates on do-while loops in which the latch is empty, and
tree-ssa-loop-ch.c operates on loops that are not do-while. I don't see
code duplication there.

But it does look like there is some code duplication with respect to the
loop-duplication utility cfgloopmanip.c:duplicate_loop_to_header_edge. This
utility duplicates a loop to the preheader-edge of the loop. In the
vectorizer we sometimes need to peel to the preheader-edge and sometimes to
the exit-edge, so the original loop is always the loop we vectorize, and
the newly created peel loops remain scalar. It should probably be possible
to convert the code in the vectorizer to use the cfgloopmanip.c utility; to
do that we'll need to at least copy all the information we record in the
stmts of the original loop to the new loop copy. I'll need to look closer
to see if there are other problems. There's also the utilities for
ssa-renaming after loop duplication in tree-ssa-loop-manip.c and in
tree-cfg.c which may be possible to reuse. So hopefully the following could
be eliminated (?):
>  - slpeel_tree_duplicate_loop_to_edge_cfg
>  - slpeel_update_phis_for_duplictae_loop
>  - allocate_new_names
>  - rename_use_op
>  - rename_def_op
>  - rename_variables_in_bb
>  - free_new_names
>  - rename_variables_in_loop

AFAIK the rest provides new functionality (but only for "simple loops" -
with empty latch, single exit, single bb):

> - slpeel_tree_peel_loop_to_edge
>   - slpeel_update_phi_nodes_for_guard
>   - slpeel_make_loop_iterate_ntimes
>   - slpeel_add_loop_guard
>   - slpeel_can_duplicate_loop_p
>   - slpeel_verify_cfg_after_peeling

I can't clean this up right now.  I guess I'll leave these in
tree-vectorize.c for now. Is there a code-duplication bugzilla keyword?

> > tree-vectorizer.c: main driver and general vectorization utilities
> > tree-vect-analyze.c: analysis functions
> > tree-vect-transform.c: transformation functions
> These seem ok.
> > Would this be acceptable for 4.0?
> Yeah.

ok, I'll prepare a patch


> r~

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