[lno] fix lv

Devang Patel dpatel@apple.com
Sat Jan 31 00:43:00 GMT 2004


While checking-in loop versioning yesterday, I resolved last minute
cvs conflict incorrectly. This patch fixes it.

Tested on powerpc-darwin

  2004-01-30  Devang Patel  <dpatel@apple.com>

        * cfgloopmanip.c (loopify): Always redirect switch_bb's 
BRANCH_EDGE,
        however redirect FALLTHRU_EDGE only if asked.
        * tree-ssa-loop-manip.c (tree_ssa_loop_version): Update 
FALLTHRU_EDGE
        pending stmts.


-
Devang

Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.3.2.11.2.5
diff -Idpatel.pbxuser -c -3 -p -r1.3.2.11.2.5 cfgloopmanip.c
*** cfgloopmanip.c      30 Jan 2004 01:37:37 -0000      1.3.2.11.2.5
--- cfgloopmanip.c      31 Jan 2004 00:33:19 -0000
*************** loopify (struct loops *loops, edge latch
*** 511,524 ****

     /* Redirect edges.  */
     loop_redirect_edge (latch_edge, loop->header);
!   loop_redirect_edge (FALLTHRU_EDGE (switch_bb), succ_bb);

     /* During loop versioning, one of the switch_bb edge is already 
properly
        set. Do not redirect it again unless redirect_all_edges is true. 
  */
     if (redirect_all_edges)
       {
         loop_redirect_edge (header_edge, switch_bb);
!       loop_redirect_edge (BRANCH_EDGE (switch_bb), loop->header);

         /* Update dominators.  */
         set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb);
--- 511,524 ----

     /* Redirect edges.  */
     loop_redirect_edge (latch_edge, loop->header);
!   loop_redirect_edge (BRANCH_EDGE (switch_bb), succ_bb);

     /* During loop versioning, one of the switch_bb edge is already 
properly
        set. Do not redirect it again unless redirect_all_edges is true. 
  */
     if (redirect_all_edges)
       {
         loop_redirect_edge (header_edge, switch_bb);
!       loop_redirect_edge (FALLTHRU_EDGE (switch_bb), loop->header);

         /* Update dominators.  */
         set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb);
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-manip.c,v
retrieving revision 1.1.2.2
diff -Idpatel.pbxuser -c -3 -p -r1.1.2.2 tree-ssa-loop-manip.c
*** tree-ssa-loop-manip.c       30 Jan 2004 01:37:37 -0000      1.1.2.2
--- tree-ssa-loop-manip.c       31 Jan 2004 00:33:19 -0000
*************** tree_ssa_loop_version (struct loops *loo
*** 709,715 ****
     lv_update_pending_stmts (latch_edge);

     /* loopify redirected condition_bb's succ edge. Update its 
PENDING_STMTS.  */
!   lv_update_pending_stmts (condition_bb->succ);

     /* At this point condition_bb is loop predheader with two 
successors,
        first_head and second_head.   Make sure that loop predheader has 
only
--- 709,715 ----
     lv_update_pending_stmts (latch_edge);

     /* loopify redirected condition_bb's succ edge. Update its 
PENDING_STMTS.  */
!   lv_update_pending_stmts (FALLTHRU_EDGE (condition_bb));

     /* At this point condition_bb is loop predheader with two 
successors,
        first_head and second_head.   Make sure that loop predheader has 
only



More information about the Gcc-patches mailing list