tree-ssa-dce.c (worklist): Change to VEC(tree,heap).
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 23 Apr 2005 15:14:32 +0000 (15:14 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 23 Apr 2005 15:14:32 +0000 (15:14 +0000)
* tree-ssa-dce.c (worklist): Change to VEC(tree,heap).
(mark_stmt_necessary, propagate_necessity,
mark_really_necessary_kill_operand_phis): Update uses of
worklist.
(tree_dce_init): Allocate worklist using VEC_alloc.
(tree_dce_done): Free worklist using VEC_free.

From-SVN: r98618

gcc/ChangeLog
gcc/tree-ssa-dce.c

index 164a4a3c9271ad55e17fd75fe6411106bec34636..3d2a241204cf1d06fbadd24b128e938909851eb0 100644 (file)
@@ -7,6 +7,13 @@
        * tree-ssa-live.c (build_tree_conflict_graph): Allocate
        partition_link and tpa_nodes on heap.
 
+       * tree-ssa-dce.c (worklist): Change to VEC(tree,heap).
+       (mark_stmt_necessary, propagate_necessity,
+       mark_really_necessary_kill_operand_phis): Update uses of
+       worklist.
+       (tree_dce_init): Allocate worklist using VEC_alloc.
+       (tree_dce_done): Free worklist using VEC_free.
+
 2005-04-23  Mike Stump  <mrs@apple.com>
 
        * config/darwin.c (machopic_indirection_name): Don't use
index f152321ab9a940af08923a62c69ac6cfbfb7f381..fd58ea124474ff1a305a2049c2f4153c81b82a1a 100644 (file)
@@ -74,7 +74,7 @@ static struct stmt_stats
   int removed_phis;
 } stats;
 
-static varray_type worklist;
+static VEC(tree,heap) *worklist;
 
 /* Vector indicating an SSA name has already been processed and marked
    as necessary.  */
@@ -235,7 +235,7 @@ mark_stmt_necessary (tree stmt, bool add_to_worklist)
 
   NECESSARY (stmt) = 1;
   if (add_to_worklist)
-    VARRAY_PUSH_TREE (worklist, stmt);
+    VEC_safe_push (tree, heap, worklist, stmt);
 }
 
 /* Mark the statement defining operand OP as necessary.  PHIONLY is true
@@ -263,7 +263,7 @@ mark_operand_necessary (tree op, bool phionly)
     return;
 
   NECESSARY (stmt) = 1;
-  VARRAY_PUSH_TREE (worklist, stmt);
+  VEC_safe_push (tree, heap, worklist, stmt);
 }
 \f
 
@@ -472,11 +472,10 @@ propagate_necessity (struct edge_list *el)
   if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "\nProcessing worklist:\n");
 
-  while (VARRAY_ACTIVE_SIZE (worklist) > 0)
+  while (VEC_length (tree, worklist) > 0)
     {
       /* Take `i' from worklist.  */
-      i = VARRAY_TOP_TREE (worklist);
-      VARRAY_POP (worklist);
+      i = VEC_pop (tree, worklist);
 
       if (dump_file && (dump_flags & TDF_DETAILS))
        {
@@ -603,10 +602,9 @@ mark_really_necessary_kill_operand_phis (void)
   
   /* Mark all virtual phis still in use as necessary, and all of their
      arguments that are phis as necessary.  */
-  while (VARRAY_ACTIVE_SIZE (worklist) > 0)
+  while (VEC_length (tree, worklist) > 0)
     {
-      tree use = VARRAY_TOP_TREE (worklist);
-      VARRAY_POP (worklist);
+      tree use = VEC_pop (tree, worklist);
       
       for (i = 0; i < PHI_NUM_ARGS (use); i++)
        mark_operand_necessary (PHI_ARG_DEF (use, i), true);
@@ -827,7 +825,7 @@ tree_dce_init (bool aggressive)
   processed = sbitmap_alloc (num_ssa_names + 1);
   sbitmap_zero (processed);
 
-  VARRAY_TREE_INIT (worklist, 64, "work list");
+  worklist = VEC_alloc (tree, heap, 64);
 }
 
 /* Cleanup after this pass.  */
@@ -848,6 +846,8 @@ tree_dce_done (bool aggressive)
     }
 
   sbitmap_free (processed);
+
+  VEC_free (tree, heap, worklist);
 }
 \f
 /* Main routine to eliminate dead code.