This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[patch] make argument of duplicate_loop_to_header_edge VEC


Hello,

this patch makes the argument of duplicate_loop_to_header_edge (that is
used to record the edges that need to be removed) VEC(edge, heap).
Bootstrapped & regtested on i686 (with -funswitch-loop -funroll-loops),
commited.

Zdenek

Index: ChangeLog
===================================================================
*** ChangeLog	(revision 120072)
--- ChangeLog	(working copy)
***************
*** 1,3 ****
--- 1,26 ----
+ 2006-12-20  Zdenek Dvorak <dvorakz@suse.cz>
+ 
+ 	* loop-unswitch.c (unswitch_loop): Update arguments of
+ 	duplicate_loop_to_header_edge call.
+ 	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Ditto.
+ 	* loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations,
+ 	unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid):
+ 	Ditto.
+ 	* cfgloopmanip.c (loop_version): Ditto.
+ 	(duplicate_loop_to_header_edge): Change
+ 	type of to_remove to VEC(edge), remove n_to_remove argument.
+ 	* tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge):
+ 	Change type of to_remove to VEC(edge), remove n_to_remove argument.
+ 	(tree_unroll_loop): Update arguments of
+ 	tree_duplicate_loop_to_header_edge call.
+ 	* cfghooks.c (cfg_hook_duplicate_loop_to_header_edge):
+ 	Change type of to_remove to VEC(edge), remove n_to_remove argument.
+ 	* cfghooks.h (struct cfg_hooks): Type of
+ 	cfg_hook_duplicate_loop_to_header_edge changed.
+ 	(cfg_hook_duplicate_loop_to_header_edge): Declaration changed.
+ 	* cfgloop.h (duplicate_loop_to_header_edge): Ditto.
+ 	* tree-flow.h (tree_duplicate_loop_to_header_edge): Ditto.
+ 
  2006-12-20  Jan Hubicka  <jh@suse.cz>
  
  	* cgraph.c: Update overall comment; fix vertical spacing.
Index: loop-unswitch.c
===================================================================
*** loop-unswitch.c	(revision 120072)
--- loop-unswitch.c	(working copy)
*************** unswitch_loop (struct loop *loop, basic_
*** 410,423 ****
    irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
    entry->flags &= ~EDGE_IRREDUCIBLE_LOOP;
    zero_bitmap = sbitmap_alloc (2);
-   sbitmap_zero (zero_bitmap);
    if (!duplicate_loop_to_header_edge (loop, entry, 1,
! 	zero_bitmap, NULL, NULL, NULL, 0))
!     {
!       sbitmap_free (zero_bitmap);
!       return NULL;
!     }
!   sbitmap_free (zero_bitmap);
    entry->flags |= irred_flag;
  
    /* Record the block with condition we unswitch on.  */
--- 410,418 ----
    irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
    entry->flags &= ~EDGE_IRREDUCIBLE_LOOP;
    zero_bitmap = sbitmap_alloc (2);
    if (!duplicate_loop_to_header_edge (loop, entry, 1,
! 			      	      NULL, NULL, NULL, 0))
!     return NULL;
    entry->flags |= irred_flag;
  
    /* Record the block with condition we unswitch on.  */
Index: cfgloopmanip.c
===================================================================
*** cfgloopmanip.c	(revision 120072)
--- cfgloopmanip.c	(working copy)
*************** update_single_exit_for_duplicated_loops 
*** 814,824 ****
     original LOOP body, the other copies are numbered in order given by control
     flow through them) into TO_REMOVE array.  Returns false if duplication is
     impossible.  */
  bool
  duplicate_loop_to_header_edge (struct loop *loop, edge e,
  			       unsigned int ndupl, sbitmap wont_exit,
! 			       edge orig, edge *to_remove,
! 			       unsigned int *n_to_remove, int flags)
  {
    struct loop *target, *aloop;
    struct loop **orig_loops;
--- 814,825 ----
     original LOOP body, the other copies are numbered in order given by control
     flow through them) into TO_REMOVE array.  Returns false if duplication is
     impossible.  */
+ 
  bool
  duplicate_loop_to_header_edge (struct loop *loop, edge e,
  			       unsigned int ndupl, sbitmap wont_exit,
! 			       edge orig, VEC (edge, heap) **to_remove,
! 			       int flags)
  {
    struct loop *target, *aloop;
    struct loop **orig_loops;
*************** duplicate_loop_to_header_edge (struct lo
*** 966,975 ****
    if (current_loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS)
      update_single_exits_after_duplication (bbs, n, target);
  
-   /* Record exit edge in original loop body.  */
-   if (orig && TEST_BIT (wont_exit, 0))
-     to_remove[(*n_to_remove)++] = orig;
- 
    spec_edges[SE_ORIG] = orig;
    spec_edges[SE_LATCH] = latch_edge;
  
--- 967,972 ----
*************** duplicate_loop_to_header_edge (struct lo
*** 1043,1049 ****
  
        /* Record exit edge in this copy.  */
        if (orig && TEST_BIT (wont_exit, j + 1))
! 	to_remove[(*n_to_remove)++] = new_spec_edges[SE_ORIG];
  
        /* Record the first copy in the control flow order if it is not
  	 the original loop (i.e. in case of peeling).  */
--- 1040,1049 ----
  
        /* Record exit edge in this copy.  */
        if (orig && TEST_BIT (wont_exit, j + 1))
! 	{
! 	  if (to_remove)
! 	    VEC_safe_push (edge, heap, *to_remove, new_spec_edges[SE_ORIG]);
! 	}
  
        /* Record the first copy in the control flow order if it is not
  	 the original loop (i.e. in case of peeling).  */
*************** duplicate_loop_to_header_edge (struct lo
*** 1063,1068 ****
--- 1063,1075 ----
    free (new_bbs);
    free (orig_loops);
  
+   /* Record the exit edge in the original loop body, and update the frequencies.  */
+   if (orig && TEST_BIT (wont_exit, 0))
+     {
+       if (to_remove)
+ 	VEC_safe_push (edge, heap, *to_remove, orig);
+     }
+ 
    /* Update the original loop.  */
    if (!is_latch)
      set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src);
*************** loop_version (struct loop *loop,
*** 1302,1308 ****
  
    /* Duplicate loop.  */
    if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
! 					       NULL, NULL, NULL, NULL, 0))
      return NULL;
  
    /* After duplication entry edge now points to new loop head block.
--- 1309,1315 ----
  
    /* Duplicate loop.  */
    if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
! 					       NULL, NULL, NULL, 0))
      return NULL;
  
    /* After duplication entry edge now points to new loop head block.
Index: tree-ssa-loop-manip.c
===================================================================
*** tree-ssa-loop-manip.c	(revision 120072)
--- tree-ssa-loop-manip.c	(working copy)
*************** copy_phi_node_args (unsigned first_new_b
*** 562,569 ****
  bool
  tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
  				    unsigned int ndupl, sbitmap wont_exit,
! 				    edge orig, edge *to_remove,
! 				    unsigned int *n_to_remove, int flags)
  {
    unsigned first_new_block;
  
--- 562,569 ----
  bool
  tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
  				    unsigned int ndupl, sbitmap wont_exit,
! 				    edge orig, VEC (edge, heap) **to_remove,
! 				    int flags)
  {
    unsigned first_new_block;
  
*************** tree_duplicate_loop_to_header_edge (stru
*** 578,584 ****
  
    first_new_block = last_basic_block;
    if (!duplicate_loop_to_header_edge (loop, e, ndupl, wont_exit,
! 				      orig, to_remove, n_to_remove, flags))
      return false;
  
    /* Readd the removed phi args for e.  */
--- 578,584 ----
  
    first_new_block = last_basic_block;
    if (!duplicate_loop_to_header_edge (loop, e, ndupl, wont_exit,
! 				      orig, to_remove, flags))
      return false;
  
    /* Readd the removed phi args for e.  */
*************** tree_unroll_loop (struct loop *loop, uns
*** 853,859 ****
    sbitmap_ones (wont_exit);
    ok = tree_duplicate_loop_to_header_edge
  	  (loop, loop_latch_edge (loop), factor - 1,
! 	   wont_exit, NULL, NULL, NULL, DLTHE_FLAG_UPDATE_FREQ);
    free (wont_exit);
    gcc_assert (ok);
    update_ssa (TODO_update_ssa);
--- 853,859 ----
    sbitmap_ones (wont_exit);
    ok = tree_duplicate_loop_to_header_edge
  	  (loop, loop_latch_edge (loop), factor - 1,
! 	   wont_exit, exit, NULL, DLTHE_FLAG_UPDATE_FREQ);
    free (wont_exit);
    gcc_assert (ok);
    update_ssa (TODO_update_ssa);
Index: cfghooks.c
===================================================================
*** cfghooks.c	(revision 120072)
--- cfghooks.c	(working copy)
*************** bool
*** 939,952 ****
  cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e,
  					unsigned int ndupl,
  					sbitmap wont_exit, edge orig,
! 					edge *to_remove,
! 					unsigned int *n_to_remove, int flags)
  {
    gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge);
    return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e,
  							    ndupl, wont_exit,
  							    orig, to_remove,
! 							    n_to_remove, flags);
  }
  
  /* Conditional jumps are represented differently in trees and RTL,
--- 939,952 ----
  cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e,
  					unsigned int ndupl,
  					sbitmap wont_exit, edge orig,
! 					VEC (edge, heap) **to_remove,
! 					int flags)
  {
    gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge);
    return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e,
  							    ndupl, wont_exit,
  							    orig, to_remove,
! 							    flags);
  }
  
  /* Conditional jumps are represented differently in trees and RTL,
Index: cfghooks.h
===================================================================
*** cfghooks.h	(revision 120072)
--- cfghooks.h	(working copy)
*************** struct cfg_hooks
*** 111,122 ****
  
    /* A hook for duplicating loop in CFG, currently this is used
       in loop versioning.  */
!   bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e,
! 						  unsigned int ndupl,
! 						  sbitmap wont_exit,
! 						  edge orig, edge *to_remove,
! 						  unsigned int *n_to_remove,
! 						  int flags);
  
    /* Add condition to new basic block and update CFG used in loop
       versioning.  */
--- 111,120 ----
  
    /* A hook for duplicating loop in CFG, currently this is used
       in loop versioning.  */
!   bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *, edge,
! 						  unsigned, sbitmap,
! 						  edge, VEC (edge, heap) **,
! 						  int);
  
    /* Add condition to new basic block and update CFG used in loop
       versioning.  */
*************** extern void execute_on_shrinking_pred (e
*** 165,172 ****
  extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
  						    unsigned int ndupl,
  						    sbitmap wont_exit,
! 						    edge orig, edge *to_remove,
! 						    unsigned int *n_to_remove,
  						    int flags);
  
  extern void lv_flush_pending_stmts (edge);
--- 163,170 ----
  extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
  						    unsigned int ndupl,
  						    sbitmap wont_exit,
! 						    edge orig,
! 						    VEC (edge, heap) **to_remove,
  						    int flags);
  
  extern void lv_flush_pending_stmts (edge);
Index: tree-ssa-loop-ivcanon.c
===================================================================
*** tree-ssa-loop-ivcanon.c	(revision 120072)
--- tree-ssa-loop-ivcanon.c	(working copy)
*************** try_unroll_loop_completely (struct loop 
*** 223,230 ****
    if (n_unroll)
      {
        sbitmap wont_exit;
-       edge *edges_to_remove = XNEWVEC (edge, n_unroll);
-       unsigned int n_to_remove = 0;
  
        old_cond = COND_EXPR_COND (cond);
        COND_EXPR_COND (cond) = dont_exit;
--- 223,228 ----
*************** try_unroll_loop_completely (struct loop 
*** 237,244 ****
  
        if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					       n_unroll, wont_exit,
! 					       exit, edges_to_remove,
! 					       &n_to_remove,
  					       DLTHE_FLAG_UPDATE_FREQ
  					       | DLTHE_FLAG_COMPLETTE_PEEL))
  	{
--- 235,241 ----
  
        if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					       n_unroll, wont_exit,
! 					       exit, NULL,
  					       DLTHE_FLAG_UPDATE_FREQ
  					       | DLTHE_FLAG_COMPLETTE_PEEL))
  	{
*************** try_unroll_loop_completely (struct loop 
*** 246,256 ****
  	  update_stmt (cond);
            free_original_copy_tables ();
  	  free (wont_exit);
- 	  free (edges_to_remove);
  	  return false;
  	}
        free (wont_exit);
-       free (edges_to_remove);
        free_original_copy_tables ();
      }
    
--- 243,251 ----
Index: loop-unroll.c
===================================================================
*** loop-unroll.c	(revision 120072)
--- loop-unroll.c	(working copy)
*************** peel_loop_completely (struct loop *loop)
*** 446,453 ****
  {
    sbitmap wont_exit;
    unsigned HOST_WIDE_INT npeel;
!   unsigned n_remove_edges, i;
!   edge *remove_edges, ein;
    struct niter_desc *desc = get_simple_loop_desc (loop);
    struct opt_info *opt_info = NULL;
    
--- 446,454 ----
  {
    sbitmap wont_exit;
    unsigned HOST_WIDE_INT npeel;
!   unsigned i;
!   VEC (edge, heap) *remove_edges;
!   edge ein;
    struct niter_desc *desc = get_simple_loop_desc (loop);
    struct opt_info *opt_info = NULL;
    
*************** peel_loop_completely (struct loop *loop)
*** 463,470 ****
        if (desc->noloop_assumptions)
  	RESET_BIT (wont_exit, 1);
  
!       remove_edges = XCNEWVEC (edge, npeel);
!       n_remove_edges = 0;
  
        if (flag_split_ivs_in_unroller)
          opt_info = analyze_insns_in_loop (loop);
--- 464,470 ----
        if (desc->noloop_assumptions)
  	RESET_BIT (wont_exit, 1);
  
!       remove_edges = NULL;
  
        if (flag_split_ivs_in_unroller)
          opt_info = analyze_insns_in_loop (loop);
*************** peel_loop_completely (struct loop *loop)
*** 473,479 ****
        ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					  npeel,
  					  wont_exit, desc->out_edge,
! 					  remove_edges, &n_remove_edges,
  					  DLTHE_FLAG_UPDATE_FREQ
  					  | DLTHE_FLAG_COMPLETTE_PEEL
  					  | (opt_info
--- 473,479 ----
        ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					  npeel,
  					  wont_exit, desc->out_edge,
! 					  &remove_edges,
  					  DLTHE_FLAG_UPDATE_FREQ
  					  | DLTHE_FLAG_COMPLETTE_PEEL
  					  | (opt_info
*************** peel_loop_completely (struct loop *loop)
*** 489,497 ****
   	}
  
        /* Remove the exit edges.  */
!       for (i = 0; i < n_remove_edges; i++)
! 	remove_path (remove_edges[i]);
!       free (remove_edges);
      }
  
    ein = desc->in_edge;
--- 489,497 ----
   	}
  
        /* Remove the exit edges.  */
!       for (i = 0; VEC_iterate (edge, remove_edges, i, ein); i++)
! 	remove_path (ein);
!       VEC_free (edge, heap, remove_edges);
      }
  
    ein = desc->in_edge;
*************** unroll_loop_constant_iterations (struct 
*** 630,637 ****
    unsigned HOST_WIDE_INT niter;
    unsigned exit_mod;
    sbitmap wont_exit;
!   unsigned n_remove_edges, i;
!   edge *remove_edges;
    unsigned max_unroll = loop->lpt_decision.times;
    struct niter_desc *desc = get_simple_loop_desc (loop);
    bool exit_at_end = loop_exit_at_end_p (loop);
--- 630,638 ----
    unsigned HOST_WIDE_INT niter;
    unsigned exit_mod;
    sbitmap wont_exit;
!   unsigned i;
!   VEC (edge, heap) *remove_edges;
!   edge e;
    unsigned max_unroll = loop->lpt_decision.times;
    struct niter_desc *desc = get_simple_loop_desc (loop);
    bool exit_at_end = loop_exit_at_end_p (loop);
*************** unroll_loop_constant_iterations (struct 
*** 648,655 ****
    wont_exit = sbitmap_alloc (max_unroll + 1);
    sbitmap_ones (wont_exit);
  
!   remove_edges = XCNEWVEC (edge, max_unroll + exit_mod + 1);
!   n_remove_edges = 0;
    if (flag_split_ivs_in_unroller 
        || flag_variable_expansion_in_unroller)
      opt_info = analyze_insns_in_loop (loop);
--- 649,655 ----
    wont_exit = sbitmap_alloc (max_unroll + 1);
    sbitmap_ones (wont_exit);
  
!   remove_edges = NULL;
    if (flag_split_ivs_in_unroller 
        || flag_variable_expansion_in_unroller)
      opt_info = analyze_insns_in_loop (loop);
*************** unroll_loop_constant_iterations (struct 
*** 674,680 ****
            ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					      exit_mod,
  					      wont_exit, desc->out_edge,
! 					      remove_edges, &n_remove_edges,
  					      DLTHE_FLAG_UPDATE_FREQ
  					      | (opt_info && exit_mod > 1
  						 ? DLTHE_RECORD_COPY_NUMBER
--- 674,680 ----
            ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					      exit_mod,
  					      wont_exit, desc->out_edge,
! 					      &remove_edges,
  					      DLTHE_FLAG_UPDATE_FREQ
  					      | (opt_info && exit_mod > 1
  						 ? DLTHE_RECORD_COPY_NUMBER
*************** unroll_loop_constant_iterations (struct 
*** 713,719 ****
  	  ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					      exit_mod + 1,
  					      wont_exit, desc->out_edge,
! 					      remove_edges, &n_remove_edges,
  					      DLTHE_FLAG_UPDATE_FREQ
  					      | (opt_info && exit_mod > 0
  						 ? DLTHE_RECORD_COPY_NUMBER
--- 713,719 ----
  	  ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					      exit_mod + 1,
  					      wont_exit, desc->out_edge,
! 					      &remove_edges,
  					      DLTHE_FLAG_UPDATE_FREQ
  					      | (opt_info && exit_mod > 0
  						 ? DLTHE_RECORD_COPY_NUMBER
*************** unroll_loop_constant_iterations (struct 
*** 740,746 ****
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      max_unroll,
  				      wont_exit, desc->out_edge,
! 				      remove_edges, &n_remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
--- 740,746 ----
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      max_unroll,
  				      wont_exit, desc->out_edge,
! 				      &remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
*************** unroll_loop_constant_iterations (struct 
*** 777,785 ****
    desc->niter_expr = GEN_INT (desc->niter);
  
    /* Remove the edges.  */
!   for (i = 0; i < n_remove_edges; i++)
!     remove_path (remove_edges[i]);
!   free (remove_edges);
  
    if (dump_file)
      fprintf (dump_file,
--- 777,785 ----
    desc->niter_expr = GEN_INT (desc->niter);
  
    /* Remove the edges.  */
!   for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
!     remove_path (e);
!   VEC_free (edge, heap, remove_edges);
  
    if (dump_file)
      fprintf (dump_file,
*************** unroll_loop_runtime_iterations (struct l
*** 923,930 ****
    unsigned n_dom_bbs;
    sbitmap wont_exit;
    int may_exit_copy;
!   unsigned n_peel, n_remove_edges;
!   edge *remove_edges, e;
    bool extra_zero_check, last_may_exit;
    unsigned max_unroll = loop->lpt_decision.times;
    struct niter_desc *desc = get_simple_loop_desc (loop);
--- 923,931 ----
    unsigned n_dom_bbs;
    sbitmap wont_exit;
    int may_exit_copy;
!   unsigned n_peel;
!   VEC (edge, heap) *remove_edges;
!   edge e;
    bool extra_zero_check, last_may_exit;
    unsigned max_unroll = loop->lpt_decision.times;
    struct niter_desc *desc = get_simple_loop_desc (loop);
*************** unroll_loop_runtime_iterations (struct l
*** 995,1002 ****
    /* Precondition the loop.  */
    split_edge_and_insert (loop_preheader_edge (loop), init_code);
  
!   remove_edges = XCNEWVEC (edge, max_unroll + n_peel + 1);
!   n_remove_edges = 0;
  
    wont_exit = sbitmap_alloc (max_unroll + 2);
  
--- 996,1002 ----
    /* Precondition the loop.  */
    split_edge_and_insert (loop_preheader_edge (loop), init_code);
  
!   remove_edges = NULL;
  
    wont_exit = sbitmap_alloc (max_unroll + 2);
  
*************** unroll_loop_runtime_iterations (struct l
*** 1011,1017 ****
    ezc_swtch = loop_preheader_edge (loop)->src;
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  				      1, wont_exit, desc->out_edge,
! 				      remove_edges, &n_remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
  
--- 1011,1017 ----
    ezc_swtch = loop_preheader_edge (loop)->src;
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  				      1, wont_exit, desc->out_edge,
! 				      &remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
  
*************** unroll_loop_runtime_iterations (struct l
*** 1026,1032 ****
  	SET_BIT (wont_exit, 1);
        ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					  1, wont_exit, desc->out_edge,
! 					  remove_edges, &n_remove_edges,
  					  DLTHE_FLAG_UPDATE_FREQ);
        gcc_assert (ok);
  
--- 1026,1032 ----
  	SET_BIT (wont_exit, 1);
        ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
  					  1, wont_exit, desc->out_edge,
! 					  &remove_edges,
  					  DLTHE_FLAG_UPDATE_FREQ);
        gcc_assert (ok);
  
*************** unroll_loop_runtime_iterations (struct l
*** 1082,1088 ****
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      max_unroll,
  				      wont_exit, desc->out_edge,
! 				      remove_edges, &n_remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
--- 1082,1088 ----
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      max_unroll,
  				      wont_exit, desc->out_edge,
! 				      &remove_edges,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
*************** unroll_loop_runtime_iterations (struct l
*** 1116,1124 ****
      }
  
    /* Remove the edges.  */
!   for (i = 0; i < n_remove_edges; i++)
!     remove_path (remove_edges[i]);
!   free (remove_edges);
  
    /* We must be careful when updating the number of iterations due to
       preconditioning and the fact that the value must be valid at entry
--- 1116,1124 ----
      }
  
    /* Remove the edges.  */
!   for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
!     remove_path (e);
!   VEC_free (edge, heap, remove_edges);
  
    /* We must be careful when updating the number of iterations due to
       preconditioning and the fact that the value must be valid at entry
*************** peel_loop_simple (struct loop *loop)
*** 1264,1271 ****
    opt_info_start_duplication (opt_info);
    
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! 				      npeel, wont_exit,
! 				      NULL, NULL,
  				      NULL, DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
--- 1264,1270 ----
    opt_info_start_duplication (opt_info);
    
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! 				      npeel, wont_exit, NULL,
  				      NULL, DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
*************** unroll_loop_stupid (struct loop *loop)
*** 1416,1422 ****
    
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      nunroll, wont_exit,
! 				      NULL, NULL, NULL,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
--- 1415,1421 ----
    
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
  				      nunroll, wont_exit,
! 				      NULL, NULL,
  				      DLTHE_FLAG_UPDATE_FREQ
  				      | (opt_info
  					 ? DLTHE_RECORD_COPY_NUMBER
Index: cfgloop.h
===================================================================
*** cfgloop.h	(revision 120072)
--- cfgloop.h	(working copy)
*************** extern bool can_duplicate_loop_p (struct
*** 251,258 ****
  
  extern struct loop * duplicate_loop (struct loop *, struct loop *);
  extern bool duplicate_loop_to_header_edge (struct loop *, edge, 
! 					   unsigned, sbitmap, edge, edge *,
! 					   unsigned *, int);
  extern struct loop *loopify (edge, edge,
  			     basic_block, edge, edge, bool);
  struct loop * loop_version (struct loop *, void *,
--- 251,258 ----
  
  extern struct loop * duplicate_loop (struct loop *, struct loop *);
  extern bool duplicate_loop_to_header_edge (struct loop *, edge, 
! 					   unsigned, sbitmap, edge,
!  					   VEC (edge, heap) **, int);
  extern struct loop *loopify (edge, edge,
  			     basic_block, edge, edge, bool);
  struct loop * loop_version (struct loop *, void *,
Index: tree-flow.h
===================================================================
*** tree-flow.h	(revision 120072)
--- tree-flow.h	(working copy)
*************** basic_block ip_end_pos (struct loop *);
*** 882,889 ****
  basic_block ip_normal_pos (struct loop *);
  bool tree_duplicate_loop_to_header_edge (struct loop *, edge,
  					 unsigned int, sbitmap,
! 					 edge, edge *,
! 					 unsigned int *, int);
  struct loop *tree_ssa_loop_version (struct loop *, tree,
  				    basic_block *);
  tree expand_simple_operations (tree);
--- 882,889 ----
  basic_block ip_normal_pos (struct loop *);
  bool tree_duplicate_loop_to_header_edge (struct loop *, edge,
  					 unsigned int, sbitmap,
! 					 edge, VEC (edge, heap) **,
! 					 int);
  struct loop *tree_ssa_loop_version (struct loop *, tree,
  				    basic_block *);
  tree expand_simple_operations (tree);


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