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]

[lno] Some bugfixes


Hello,

this patch fixes several problems I have encountered when I tried to
enable use of scev analyser in ivcanon pass. I did not catch all of
them yet -- jc1 is misscompiled with -fscalar-evolutions -ftree-loop-optimize,
so I keep it disabled for now.

The problems fixed:

-- jump threading was sometimes creating loop with shared headers
   unnecessarily (I believe Daniel complained about something similar,
   perhaps this could help his problem as well?)
-- when we are creating preheaders, some redundant phi nodes may be
   exposed, so we cleanup them now
-- number_of_iterations_in_loop did not handle case when the loop was
   exited through true branch of the exit condition correctly
-- how_far_to_positive did not handle chrec_top argument correctly
-- tree level loop unrolling did not update ssa name tags

Zdenek

Index: ChangeLog.lno
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.lno,v
retrieving revision 1.1.2.88
diff -c -3 -p -r1.1.2.88 ChangeLog.lno
*** ChangeLog.lno	15 Mar 2004 15:07:08 -0000	1.1.2.88
--- ChangeLog.lno	17 Mar 2004 18:37:53 -0000
***************
*** 1,3 ****
--- 1,30 ----
+ 2004-03-17  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+ 
+ 	* tree-cfg.c (thread_jumps): Don't thread jumps over loop headers.
+ 	* tree-flow.h (rewrite_into_ssa): Declaration changed.
+ 	(kill_redundant_phi_nodes, tree_loop_optimizer_init): Declare.
+ 	* tree-optimize.c (execute_todo): Do not free vars_to_rename.
+ 	(execute_one_pass): Do not allocate vars_to_rename.
+ 	(tree_rest_of_compilation): Allocate vars_to_rename.
+ 	* tree-scalar-evolution.c (number_of_iterations_in_loop): Handle
+ 	loops exited when condition is true.
+ 	(initialize_scalar_evolutions_analyzer): Use tree_loop_optimizer_init.
+ 	* tree-ssa-chrec.c (how_far_to_positive): Handle chrec_top correctly.
+ 	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Changed due to
+ 	rewrite_into_ssa change.
+ 	* tree-ssa-loop-im.c (move_computations, determine_lsm): Ditto.
+ 	* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ 	Use scev analyser.
+ 	* tree-ssa-loop-manip.c (allocate_new_names): Update name memory
+ 	tags.
+ 	* tree-ssa-loop.c (tree_loop_optimizer_init): New.
+ 	(tree_ssa_loop_opt, copy_loop_headers): Use it.
+ 	* tree-ssa.c (rewrite_into_ssa): Use argument to decide whether
+ 	to rename all variables.
+ 	(rewrite_all_into_ssa): New.
+ 	(pass_build_ssa): Use it.
+ 	(kill_redundant_phi_nodes): Export.
+ 
  2004-03-15  Andrew Pinski  <pinskia@physics.uc.edu>
  
  	* tree-ssa-return.c (tree_ssa_return):
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.244.2.11
diff -c -3 -p -r1.1.4.244.2.11 tree-cfg.c
*** tree-cfg.c	12 Mar 2004 15:28:56 -0000	1.1.4.244.2.11
--- tree-cfg.c	17 Mar 2004 18:37:53 -0000
*************** thread_jumps (void)
*** 3499,3509 ****
    edge e, next, last, old;
    basic_block bb, dest, tmp;
    tree phi;
!   int arg;
    bool retval = false;
  
    FOR_EACH_BB (bb)
!     bb_ann (bb)->forwardable = 1;
  
    FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
      {
--- 3499,3519 ----
    edge e, next, last, old;
    basic_block bb, dest, tmp;
    tree phi;
!   int arg, old_forwardable;
    bool retval = false;
  
+   mark_dfs_back_edges ();
    FOR_EACH_BB (bb)
!     {
!       /* Prevent threading though loop headers.  This could create irreducible
! 	 regions (for entry edges) or loops with shared headers (for latch
! 	 edges).  */
!       for (e = bb->pred; e; e = e->pred_next)
! 	if (e->flags & EDGE_DFS_BACK)
! 	  break;
! 
!       bb_ann (bb)->forwardable = (e == NULL);
!     }
  
    FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
      {
*************** thread_jumps (void)
*** 3518,3523 ****
--- 3528,3534 ----
        /* This block is now part of a forwarding path, mark it as not
  	 forwardable so that we can detect loops.   This bit will be
  	 reset below.  */
+       old_forwardable = bb_ann (bb)->forwardable;
        bb_ann (bb)->forwardable = 0;
  
        /* Examine each of our block's successors to see if it is
*************** thread_jumps (void)
*** 3541,3551 ****
  	       last = dest->succ,
  	       dest = dest->succ->dest)
  	    {
- 	      /* An infinite loop detected.  We redirect the edge anyway, so
- 		 that the loop is shrinked into single basic block.  */
- 	      if (!bb_ann (dest)->forwardable)
- 		break;
- 
  	      if (dest->succ->dest == EXIT_BLOCK_PTR)
  		break;
  
--- 3552,3557 ----
*************** thread_jumps (void)
*** 3605,3611 ****
  
        /* Reset the forwardable bit on our block since it's no longer in
  	 a forwarding chain path.  */
!       bb_ann (bb)->forwardable = 1;
      }
    return retval;
  }
--- 3611,3617 ----
  
        /* Reset the forwardable bit on our block since it's no longer in
  	 a forwarding chain path.  */
!       bb_ann (bb)->forwardable = old_forwardable;
      }
    return retval;
  }
Index: tree-chrec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-chrec.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 tree-chrec.c
*** tree-chrec.c	3 Mar 2004 18:42:15 -0000	1.1.2.6
--- tree-chrec.c	17 Mar 2004 18:37:53 -0000
*************** how_far_to_positive (unsigned evolution_
*** 3450,3456 ****
    if (chrec == NULL_TREE)
      abort ();
  #endif
!   
    if (no_evolution_in_loop_p (chrec, evolution_loop_num))
      {
        chrec = initial_condition (chrec);
--- 3450,3459 ----
    if (chrec == NULL_TREE)
      abort ();
  #endif
! 
!   if (chrec == chrec_top)
!     return chrec_top;
! 
    if (no_evolution_in_loop_p (chrec, evolution_loop_num))
      {
        chrec = initial_condition (chrec);
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.177.2.14
diff -c -3 -p -r1.1.4.177.2.14 tree-flow.h
*** tree-flow.h	12 Mar 2004 01:28:29 -0000	1.1.4.177.2.14
--- tree-flow.h	17 Mar 2004 18:37:53 -0000
*************** typedef void (*walk_use_def_chains_fn) (
*** 559,565 ****
  
  /* In tree-ssa.c  */
  extern void init_tree_ssa (void);
! extern void rewrite_into_ssa (void);
  extern void rewrite_vars_out_of_ssa (bitmap);
  extern void dump_reaching_defs (FILE *);
  extern void debug_reaching_defs (void);
--- 559,565 ----
  
  /* In tree-ssa.c  */
  extern void init_tree_ssa (void);
! extern void rewrite_into_ssa (bool);
  extern void rewrite_vars_out_of_ssa (bitmap);
  extern void dump_reaching_defs (FILE *);
  extern void debug_reaching_defs (void);
*************** extern void verify_ssa (void);
*** 577,582 ****
--- 577,583 ----
  extern void delete_tree_ssa (void);
  extern void register_new_def (tree, tree, varray_type *, varray_type);
  extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *);
+ extern void kill_redundant_phi_nodes (void);
  
  extern unsigned int highest_ssa_version;
  
*************** extern void propagate_value (tree *, tre
*** 596,601 ****
--- 597,603 ----
  void tree_ssa_dce_no_cfg_changes (void);
  
  /* In tree-ssa-loop*.c  */
+ struct loops *tree_loop_optimizer_init (FILE *);
  void tree_ssa_lim (struct loops *loops);
  void tree_ssa_iv_optimize (struct loops *);
  void canonicalize_induction_variables (struct loops *loops);
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 1.1.4.98.2.16
diff -c -3 -p -r1.1.4.98.2.16 tree-optimize.c
*** tree-optimize.c	12 Mar 2004 07:17:15 -0000	1.1.4.98.2.16
--- tree-optimize.c	17 Mar 2004 18:37:53 -0000
*************** execute_todo (unsigned int flags)
*** 352,360 ****
  {
    if (flags & TODO_rename_vars)
      {
!       if (bitmap_first_set_bit (vars_to_rename) >= 0)
! 	rewrite_into_ssa ();
!       BITMAP_XFREE (vars_to_rename);
      }
  
    if ((flags & TODO_dump_func) && tree_dump_file)
--- 352,359 ----
  {
    if (flags & TODO_rename_vars)
      {
!       rewrite_into_ssa (false);
!       bitmap_clear (vars_to_rename);
      }
  
    if ((flags & TODO_dump_func) && tree_dump_file)
*************** execute_one_pass (struct tree_opt_pass *
*** 410,419 ****
    if (pass->tv_id)
      timevar_push (pass->tv_id);
  
-   /* If the pass is requesting ssa variable renaming, allocate the bitmap.  */
-   if (pass->todo_flags_finish & TODO_rename_vars)
-     vars_to_rename = BITMAP_XMALLOC ();
- 
    /* Do it!  */
    if (pass->execute)
      pass->execute ();
--- 409,414 ----
*************** tree_rest_of_compilation (tree fndecl, b
*** 534,539 ****
--- 529,537 ----
  	  timevar_pop (TV_INTEGRATION);
  	}
      }
+ 
+   if (!vars_to_rename)
+     vars_to_rename = BITMAP_XMALLOC ();
  
    /* Perform all tree transforms and optimizations.  */
    execute_pass_list (all_passes);
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.c,v
retrieving revision 1.1.2.20
diff -c -3 -p -r1.1.2.20 tree-scalar-evolution.c
*** tree-scalar-evolution.c	13 Mar 2004 09:35:37 -0000	1.1.2.20
--- tree-scalar-evolution.c	17 Mar 2004 18:37:53 -0000
*************** number_of_iterations_in_loop (struct loo
*** 2527,2532 ****
--- 2527,2533 ----
    tree res;
    tree cond, test, opnd0, opnd1;
    tree chrec0, chrec1, chrec_cond;
+   edge exit;
  
    /* Determine whether the number_of_iterations_in_loop has already
       been computed.  */
*************** number_of_iterations_in_loop (struct loo
*** 2542,2547 ****
--- 2543,2552 ----
      return set_nb_iterations_in_loop (loop, chrec_top);
    
    test = TREE_OPERAND (cond, 0);
+   exit = loop_exit_edge (loop, 0);
+   if (exit->flags & EDGE_TRUE_VALUE)
+     test = invert_truthvalue (test);
+ 
    switch (TREE_CODE (test))
      {
      case SSA_NAME:
*************** initialize_scalar_evolutions_analyzer (v
*** 2724,2730 ****
  static void
  scev_init (void)
  {
!   current_loops = loop_optimizer_init (NULL);
    if (!current_loops)
      return;
    
--- 2729,2735 ----
  static void
  scev_init (void)
  {
!   current_loops = tree_loop_optimizer_init (NULL);
    if (!current_loops)
      return;
    
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.102.2.3
diff -c -3 -p -r1.1.2.102.2.3 tree-ssa-dom.c
*** tree-ssa-dom.c	21 Feb 2004 23:10:02 -0000	1.1.2.102.2.3
--- tree-ssa-dom.c	17 Mar 2004 18:37:54 -0000
*************** tree_ssa_dominator_optimize (void)
*** 652,658 ****
        if (cfg_altered
  	  && bitmap_first_set_bit (vars_to_rename) >= 0)
  	{
! 	  rewrite_into_ssa ();
  	  bitmap_clear (vars_to_rename);
  	  VARRAY_GROW (const_and_copies, highest_ssa_version);
  	  VARRAY_GROW (vrp_data, highest_ssa_version);
--- 652,658 ----
        if (cfg_altered
  	  && bitmap_first_set_bit (vars_to_rename) >= 0)
  	{
! 	  rewrite_into_ssa (false);
  	  bitmap_clear (vars_to_rename);
  	  VARRAY_GROW (const_and_copies, highest_ssa_version);
  	  VARRAY_GROW (vrp_data, highest_ssa_version);
Index: tree-ssa-loop-im.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-im.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 tree-ssa-loop-im.c
*** tree-ssa-loop-im.c	12 Mar 2004 01:28:30 -0000	1.1.2.6
--- tree-ssa-loop-im.c	17 Mar 2004 18:37:54 -0000
*************** move_computations (void)
*** 555,563 ****
    fini_walk_dominator_tree (&walk_data);
  
    commit_inserts ();
!   if (bitmap_first_set_bit (vars_to_rename) >= 0)
!     rewrite_into_ssa ();
!   BITMAP_XFREE (vars_to_rename);
  }
  
  /* Checks whether variable in *INDEX is movable out of the loop passed
--- 555,562 ----
    fini_walk_dominator_tree (&walk_data);
  
    commit_inserts ();
!   rewrite_into_ssa (false);
!   bitmap_clear (vars_to_rename);
  }
  
  /* Checks whether variable in *INDEX is movable out of the loop passed
*************** determine_lsm (struct loops *loops)
*** 901,907 ****
  	stmt_ann (phi)->uid = max_uid++;
      }
  
-   vars_to_rename = BITMAP_XMALLOC ();
    compute_immediate_uses (TDFA_USE_VOPS, NULL);
  
    /* Pass the loops from the outermost.  For each virtual operand loop phi node
--- 900,905 ----
Index: tree-ssa-loop-ivcanon.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-ivcanon.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 tree-ssa-loop-ivcanon.c
*** tree-ssa-loop-ivcanon.c	13 Mar 2004 09:35:37 -0000	1.1.2.2
--- tree-ssa-loop-ivcanon.c	17 Mar 2004 18:37:54 -0000
*************** canonicalize_loop_induction_variables (s
*** 411,429 ****
  				       bool create_iv, bool completely_unroll)
  {
    edge exit = NULL;
!   tree niter 
! #if 0 /* Causes bootstrap to fail  */
! 	  = number_of_iterations_in_loop (loop);
  
!   if (TREE_CODE (niter) == INTEGER_CST)
!     exit = loop_exit_edge (loop, 0);
    else
!     niter  
! #endif
! 	  = find_loop_niter_by_eval (loop, &exit);
  
    if (TREE_CODE (niter) != INTEGER_CST)
      return;
  
    if (try_unroll_loop_completely (loops, loop, exit, niter, completely_unroll))
      return;
--- 411,458 ----
  				       bool create_iv, bool completely_unroll)
  {
    edge exit = NULL;
!   tree niter;
  
!   /* ??? Why is this needed?  I.e. from where comes the invalid info?  */
!   loop->nb_iterations = NULL;
! 
!   niter = number_of_iterations_in_loop (loop);
! 
!   if (0 && TREE_CODE (niter) == INTEGER_CST)
!     {
!       tree nit;
!       edge ex;
! 
!       exit = loop_exit_edge (loop, 0);
!       if (!just_once_each_iteration_p (loop, exit->src))
! 	return;
! 
!       /* The result of number_of_iterations_in_loop is by one higher than
! 	 we expect (i.e. it returns number of executions of the exit
! 	 condition, not of the loop latch edge).  */
!       niter = fold (build (PLUS_EXPR, TREE_TYPE (niter), niter,
! 			   convert (TREE_TYPE (niter),
! 				    integer_minus_one_node)));
! 
!       nit = find_loop_niter_by_eval (loop, &ex);
! 
!       if (ex == exit
! 	  && TREE_CODE (nit) == INTEGER_CST
! 	  && !operand_equal_p (niter, nit, 0))
! 	abort ();
!     }
    else
!     niter = find_loop_niter_by_eval (loop, &exit);
  
    if (TREE_CODE (niter) != INTEGER_CST)
      return;
+ 
+   if (tree_dump_file && (tree_dump_flags & TDF_DETAILS))
+     {
+       fprintf (tree_dump_file, "Loop %d iterates ", loop->num);
+       print_generic_expr (tree_dump_file, niter, TDF_SLIM);
+       fprintf (tree_dump_file, " times.\n");
+     }
  
    if (try_unroll_loop_completely (loops, loop, exit, niter, completely_unroll))
      return;
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-manip.c,v
retrieving revision 1.1.2.4
diff -c -3 -p -r1.1.2.4 tree-ssa-loop-manip.c
*** tree-ssa-loop-manip.c	12 Mar 2004 01:28:30 -0000	1.1.2.4
--- tree-ssa-loop-manip.c	17 Mar 2004 18:37:54 -0000
*************** allocate_new_names (tree definitions, un
*** 156,162 ****
  {
    tree def;
    unsigned i;
!   ssa_name_ann_t ann;
    tree *new_names;
  
    for (; definitions; definitions = TREE_CHAIN (definitions))
--- 156,162 ----
  {
    tree def;
    unsigned i;
!   ssa_name_ann_t ann, ann1;
    tree *new_names;
  
    for (; definitions; definitions = TREE_CHAIN (definitions))
*************** allocate_new_names (tree definitions, un
*** 167,174 ****
        ann->common.aux = new_names;
  
        for (i = 0; i <= ndupl; i++)
! 	new_names[i] = make_ssa_name (SSA_NAME_VAR (def),
! 				      SSA_NAME_DEF_STMT (def));
      }
  }
  
--- 167,178 ----
        ann->common.aux = new_names;
  
        for (i = 0; i <= ndupl; i++)
! 	{
! 	  new_names[i] = make_ssa_name (SSA_NAME_VAR (def),
! 					SSA_NAME_DEF_STMT (def));
! 	  ann1 = get_ssa_name_ann (new_names[i]);
! 	  ann1->name_mem_tag = ann->name_mem_tag;
! 	}
      }
  }
  
Index: tree-ssa-loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop.c,v
retrieving revision 1.1.2.3.2.13
diff -c -3 -p -r1.1.2.3.2.13 tree-ssa-loop.c
*** tree-ssa-loop.c	24 Feb 2004 23:52:28 -0000	1.1.2.3.2.13
--- tree-ssa-loop.c	17 Mar 2004 18:37:54 -0000
*************** Software Foundation, 59 Temple Place - S
*** 38,43 ****
--- 38,64 ----
  #include "flags.h"
  #include "tree-inline.h"
  
+ /* Initializes the loop structures.  DUMP is the file to that the details
+    about the analysis should be dumped.  */
+ 
+ struct loops *
+ tree_loop_optimizer_init (FILE *dump)
+ {
+   struct loops *loops = loop_optimizer_init (dump);
+ 
+   if (!loops)
+     return NULL;
+ 
+   /* Creation of preheaders may create redundant phi nodes (if the loop is
+      entered by more than one edge, but the initial value of the induction
+      variable is the same on all of them).  */
+   kill_redundant_phi_nodes ();
+   rewrite_into_ssa (false);
+   bitmap_clear (vars_to_rename);
+ 
+   return loops;
+ }
+ 
  /* The main entry into loop optimization pass.  PHASE indicates which dump file
     from the DUMP_FILES array to use when dumping debugging information.
     FNDECL is the current function decl.  */
*************** tree_ssa_loop_opt (void)
*** 47,53 ****
  {
    struct loops *loops;
  
!   loops = loop_optimizer_init (tree_dump_file);
  
    if (loops)
      {
--- 68,74 ----
  {
    struct loops *loops;
  
!   loops = tree_loop_optimizer_init (tree_dump_file);
  
    if (loops)
      {
*************** copy_loop_headers (void)
*** 305,318 ****
    edge preheader_edge;
    varray_type bbs_to_duplicate = NULL;
  
!   loops = loop_optimizer_init (tree_dump_file);
    if (!loops)
      return;
    
    /* We are not going to need or update dominators.  */
    free_dominance_info (CDI_DOMINATORS);
- 
-   create_preheaders (loops, CP_SIMPLE_PREHEADERS);
  
    /* We do not try to keep the information about irreductible regions
       up-to-date.  */
--- 326,337 ----
    edge preheader_edge;
    varray_type bbs_to_duplicate = NULL;
  
!   loops = tree_loop_optimizer_init (tree_dump_file);
    if (!loops)
      return;
    
    /* We are not going to need or update dominators.  */
    free_dominance_info (CDI_DOMINATORS);
  
    /* We do not try to keep the information about irreductible regions
       up-to-date.  */
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.180.2.4
diff -c -3 -p -r1.1.4.180.2.4 tree-ssa.c
*** tree-ssa.c	12 Mar 2004 01:28:31 -0000	1.1.4.180.2.4
--- tree-ssa.c	17 Mar 2004 18:37:54 -0000
*************** set_value_for (tree var, tree value, var
*** 321,344 ****
     Virtual operands provide safe information about potential references to
     the operands in a statement.  But they are imprecise by nature.
     Optimizations may want to take them into account, at the expense of
!    increased compilation time.  */
  
  void
! rewrite_into_ssa (void)
  {
    bitmap *dfs;
    basic_block bb;
    struct dom_walk_data walk_data;
    struct mark_def_sites_global_data mark_def_sites_global_data;
    
    timevar_push (TV_TREE_SSA_OTHER);
  
!   /* Initialize the array of variables to rename.  */
!   if (vars_to_rename != NULL)
      {
        size_t i;
        bool rename_name_tags_p;
  
        /* If any of the variables in VARS_TO_RENAME is a pointer, we need to
  	 invalidate all the name memory tags associated with the variables
  	 that we are about to rename.  FIXME: Currently we just invalidate
--- 321,360 ----
     Virtual operands provide safe information about potential references to
     the operands in a statement.  But they are imprecise by nature.
     Optimizations may want to take them into account, at the expense of
!    increased compilation time.
!    
!    ALL is true if all variables should be renamed (otherwise just those
!    mentioned in vars_to_rename are taken into account).  */
  
  void
! rewrite_into_ssa (bool all)
  {
    bitmap *dfs;
    basic_block bb;
    struct dom_walk_data walk_data;
    struct mark_def_sites_global_data mark_def_sites_global_data;
+   bitmap old_vars_to_rename = vars_to_rename;
    
    timevar_push (TV_TREE_SSA_OTHER);
  
!   if (all)
!     vars_to_rename = NULL;
!   else
      {
        size_t i;
        bool rename_name_tags_p;
  
+       /* Initialize the array of variables to rename.  */
+  
+       if (vars_to_rename == NULL)
+ 	abort ();
+ 
+       if (bitmap_first_set_bit (vars_to_rename) < 0)
+ 	{
+ 	  timevar_pop (TV_TREE_SSA_OTHER);
+ 	  return;
+ 	}
+       
        /* If any of the variables in VARS_TO_RENAME is a pointer, we need to
  	 invalidate all the name memory tags associated with the variables
  	 that we are about to rename.  FIXME: Currently we just invalidate
*************** rewrite_into_ssa (void)
*** 473,486 ****
    htab_delete (def_blocks);
    VARRAY_CLEAR (currdefs);
  
    timevar_pop (TV_TREE_SSA_OTHER);
  }
  
  struct tree_opt_pass pass_build_ssa = 
  {
    "ssa",				/* name */
    NULL,					/* gate */
!   rewrite_into_ssa,			/* execute */
    NULL,					/* sub */
    NULL,					/* next */
    0,					/* static_pass_number */
--- 489,511 ----
    htab_delete (def_blocks);
    VARRAY_CLEAR (currdefs);
  
+   vars_to_rename = old_vars_to_rename;
    timevar_pop (TV_TREE_SSA_OTHER);
  }
  
+ /* Rewrites all variables into ssa.  */
+ 
+ static void
+ rewrite_all_into_ssa (void)
+ {
+   rewrite_into_ssa (true);
+ }
+ 
  struct tree_opt_pass pass_build_ssa = 
  {
    "ssa",				/* name */
    NULL,					/* gate */
!   rewrite_all_into_ssa,			/* execute */
    NULL,					/* sub */
    NULL,					/* next */
    0,					/* static_pass_number */
*************** raise_value (tree phi, tree val, tree *e
*** 3912,3918 ****
     The most important effect of this pass is to remove degenerate PHI
     nodes created by removing unreachable code.  */
  
! static void
  kill_redundant_phi_nodes (void)
  {
    tree *eq_to, *ssa_names;
--- 3937,3943 ----
     The most important effect of this pass is to remove degenerate PHI
     nodes created by removing unreachable code.  */
  
! void
  kill_redundant_phi_nodes (void)
  {
    tree *eq_to, *ssa_names;


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