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-ssa] [RFC] loop versioning - 2

On Jan 17, 2004, at 1:50 AM, Zdenek Dvorak wrote:


Based on the feedback I received earlier
here is the second attempt.

This patch is consist of two parts. First part is to add couple of
cfghooks and do
some code rearrangements to make copy_bbs() independent of

After that second part implements loop versioning for trees using
 duplicate_loop_to_header_edge ().

If this looks good, I'll prepare patch for lno branch.

looks much better this time; I would recommend to change just few details:

1) When the loop is the part of irreducible region, all the blocks
   belonging to the copy of the loop would be marked as irreducible,
   which is not right -- see loop-unswitch:unswitch_loop for code to
   handle it (basically you need to reset the flag from the entry edge,
   then restore it again after copying).


2) It would be nice to rewrite the loop-unswitch:unswitch_loop to use
   the loop versioning code (basically replace the code between
   /* Make a copy.  */ and /* Remove branches... */ comments by call to
   the loop_version function (some small tweaking would be neccesary
   to make it fully ir-independent, but the advantage would be that the
   code would get tested thoroughly).

I intended to make it ir-independent after I spend some to make lv work
over SSA. Its a big learning curve for me, so I'd appreciate any suggestions
about how to tackle it (making tree_duplicate_bb work over SSA).

3) +   free_dominance_info (CDI_DOMINATORS);
   +   calculate_dominance_info (CDI_DOMINATORS);

   This should not be neccesary.  Use cfgloopmanip.c:loopify to create
   the new loop and the dominators will be updated automatically.

loopify() is tightly connected to loop unswitch and it also uses is iterate_fix_dominators() to update dominators. ATM, I intend to use that directly and come back to loopify() again during loop-unswitch ir cleanup.

Thank you,

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