]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate struct nb_iter_bound.
authorZdenek Dvorak <dvorakz@suse.cz>
Mon, 14 May 2007 21:58:42 +0000 (23:58 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Mon, 14 May 2007 21:58:42 +0000 (21:58 +0000)
* tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate
struct nb_iter_bound.
(free_numbers_of_iterations_estimates_loop): Use ggc_free.
* gengtype.c (open_base_files): Add cfhloop.h to the list of includes.
* cfgloopmanip.c (place_new_loop): Vector larray is gc-allocated.
* tree-scalar-evolution.c: Include gt-tree-scalar-evolution.h.
(struct scev_info_str, scalar_evolution_info): Add GTY markers.
(new_scev_info_str): Use GGC_NEW to allocate struct scev_info_str.
(del_scev_info): Use ggc_free.
(scev_initialize): Allocate scalar_evolution_info in gc memory.
* loop-init.c: Include ggc.h.
(loop_optimizer_init): Use GGC_CNEW to allocate struct loops.
(loop_optimizer_finalize): Use ggc_free.
* tree-ssa-loop.c (pass_tree_unswitch, pass_vectorize,
pass_linear_transfom, pass_empty_loop, pass_complete_unroll,
pass_iv_optimize): Add TODO_ggc_collect.
* function.h (struct function): Remove skip marker from x_current_loops.
* cfgloop.c: Include ggc.h.
(flow_loops_free, flow_loop_free): Free the loop descriptions in gc
memory.
(establish_preds): Vector superloops is gc allocated.
(alloc_loop): Allocate loop using GGC_CNEW.  Allocate head of
loop->exits list.
(flow_loops_find): Vector larray is gc allocated.
(loop_exit_free): Use ggc_free.
(rescan_loop_exit): Use GGC_NEW to allocate struct loop_exit.  Reflect
that head of exits list is now not a part of struct loop.
(record_loop_exits): Allocate exits table in gc memory.
(get_loop_exit_edges, verify_loop_structure, single_exit): Reflect that
head of exits list is now not a part of struct loop.
* cfgloop.h (struct lpt_decision, struct nb_iter_bound,
struct loop_exit): Add GTY marker.
(struct loop): Add GTY marker.  Make superloops vector gc allocated.
Add skip marker to aux field.  Make head of exits list a separate
object.
(struct loops): Add GTY marker.  Make larray vector gc allocated.
Add param marker to exits table.
(get_loops): Type changed.
* Makefile.in (tree-scalar-evolution.o): Add gt-tree-scalar-evolution.h
dependency.
(cfgloop.o, loop-init.o): Add ggc.h dependency.
(GTFILES): Add cfgloop.h and tree-scalar-evolution.c.
* basic-block.h (struct basic_block_def): Remove skip marker from
loop_father field.

From-SVN: r124727

12 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/basic-block.h
gcc/cfgloop.c
gcc/cfgloop.h
gcc/cfgloopmanip.c
gcc/function.h
gcc/gengtype.c
gcc/loop-init.c
gcc/tree-scalar-evolution.c
gcc/tree-ssa-loop-niter.c
gcc/tree-ssa-loop.c

index 21bb78ed790bdaae929c8ebd0a22270af6c550a9..26d474df6236b6c90e4231e8a1aa20357ca8b3f0 100644 (file)
@@ -1,3 +1,50 @@
+2007-05-15  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate
+       struct nb_iter_bound.
+       (free_numbers_of_iterations_estimates_loop): Use ggc_free.
+       * gengtype.c (open_base_files): Add cfhloop.h to the list of includes.
+       * cfgloopmanip.c (place_new_loop): Vector larray is gc-allocated.
+       * tree-scalar-evolution.c: Include gt-tree-scalar-evolution.h.
+       (struct scev_info_str, scalar_evolution_info): Add GTY markers.
+       (new_scev_info_str): Use GGC_NEW to allocate struct scev_info_str.
+       (del_scev_info): Use ggc_free.
+       (scev_initialize): Allocate scalar_evolution_info in gc memory.
+       * loop-init.c: Include ggc.h.
+       (loop_optimizer_init): Use GGC_CNEW to allocate struct loops.
+       (loop_optimizer_finalize): Use ggc_free.
+       * tree-ssa-loop.c (pass_tree_unswitch, pass_vectorize,
+       pass_linear_transfom, pass_empty_loop, pass_complete_unroll,
+       pass_iv_optimize): Add TODO_ggc_collect.
+       * function.h (struct function): Remove skip marker from x_current_loops.
+       * cfgloop.c: Include ggc.h.
+       (flow_loops_free, flow_loop_free): Free the loop descriptions in gc
+       memory.
+       (establish_preds): Vector superloops is gc allocated.
+       (alloc_loop): Allocate loop using GGC_CNEW.  Allocate head of
+       loop->exits list.
+       (flow_loops_find): Vector larray is gc allocated.
+       (loop_exit_free): Use ggc_free.
+       (rescan_loop_exit): Use GGC_NEW to allocate struct loop_exit.  Reflect
+       that head of exits list is now not a part of struct loop.
+       (record_loop_exits): Allocate exits table in gc memory.
+       (get_loop_exit_edges, verify_loop_structure, single_exit): Reflect that
+       head of exits list is now not a part of struct loop.
+       * cfgloop.h (struct lpt_decision, struct nb_iter_bound,
+       struct loop_exit): Add GTY marker.
+       (struct loop): Add GTY marker.  Make superloops vector gc allocated.
+       Add skip marker to aux field.  Make head of exits list a separate
+       object.
+       (struct loops): Add GTY marker.  Make larray vector gc allocated.
+       Add param marker to exits table.
+       (get_loops): Type changed.
+       * Makefile.in (tree-scalar-evolution.o): Add gt-tree-scalar-evolution.h
+       dependency.
+       (cfgloop.o, loop-init.o): Add ggc.h dependency.
+       (GTFILES): Add cfgloop.h and tree-scalar-evolution.c.
+       * basic-block.h (struct basic_block_def): Remove skip marker from
+       loop_father field.
+
 2007-05-14  Uros Bizjak  <ubizjak@gmail.com>
 
        * builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead
index ce039a29fb4828a342569c623f80a128147a6467..bdd5a86b61bac06a3e32858dc1e24b6b977bc561 100644 (file)
@@ -2188,7 +2188,8 @@ tree-chrec.o: tree-chrec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
 tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \
    coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(REAL_H) $(RTL_H) \
    $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
-   $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h
+   $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h \
+   gt-tree-scalar-evolution.h
 tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
    $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
@@ -2571,7 +2572,8 @@ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H)
 cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
    $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \
-   $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h
+   $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
+   $(GGC_H)
 cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
    $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \
    $(OBSTACK_H) output.h
@@ -2589,7 +2591,7 @@ loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
 cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
    $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \
    coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H)
-loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
+loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \
    $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \
    coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H)
 loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
@@ -2977,7 +2979,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(srcdir)/coverage.c $(srcdir)/rtl.h \
   $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
   $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
-  $(srcdir)/ipa-reference.h $(srcdir)/output.h \
+  $(srcdir)/ipa-reference.h $(srcdir)/output.h $(srcdir)/cfgloop.h \
   $(srcdir)/cselib.h $(srcdir)/basic-block.h  $(srcdir)/cgraph.h \
   $(srcdir)/reload.h \
   $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
@@ -2991,7 +2993,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
   $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
   $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
-  $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
+  $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h $(srcdir)/tree-scalar-evolution.c \
   $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
   $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
   $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
index 3116a52d7523779a19faea3c763661ee51ba4d5e..4684369e4e0b26e072c7607b18a8401af5e01496 100644 (file)
@@ -221,7 +221,7 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
   PTR GTY ((skip (""))) aux;
 
   /* Innermost loop containing the block.  */
-  struct loop * GTY ((skip (""))) loop_father;
+  struct loop *loop_father;
 
   /* The dominance and postdominance information node.  */
   struct et_node * GTY ((skip (""))) dom[2];
index c77fdafd93ce5dd6b44148d81c3dac69020c856d..66461d994af0e65c857c459276671d6d70de4fc7 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "tree-flow.h"
 #include "pointer-set.h"
 #include "output.h"
+#include "ggc.h"
 
 static void flow_loops_cfg_dump (FILE *);
 \f
@@ -174,25 +175,27 @@ flow_loops_dump (FILE *file, void (*loop_dump_aux) (const struct loop *, FILE *,
 }
 
 /* Free data allocated for LOOP.  */
+
 void
 flow_loop_free (struct loop *loop)
 {
   struct loop_exit *exit, *next;
 
-  VEC_free (loop_p, heap, loop->superloops);
+  VEC_free (loop_p, gc, loop->superloops);
 
   /* Break the list of the loop exit records.  They will be freed when the
      corresponding edge is rescanned or removed, and this avoids
      accessing the (already released) head of the list stored in the
      loop structure.  */
-  for (exit = loop->exits.next; exit != &loop->exits; exit = next)
+  for (exit = loop->exits->next; exit != loop->exits; exit = next)
     {
       next = exit->next;
       exit->next = exit;
       exit->prev = exit;
     }
-    
-  free (loop);
+
+  ggc_free (loop->exits);
+  ggc_free (loop);
 }
 
 /* Free all the memory allocated for LOOPS.  */
@@ -214,8 +217,7 @@ flow_loops_free (struct loops *loops)
          flow_loop_free (loop);
        }
 
-      VEC_free (loop_p, heap, loops->larray);
-      loops->larray = NULL;
+      VEC_free (loop_p, gc, loops->larray);
     }
 }
 
@@ -286,7 +288,7 @@ establish_preds (struct loop *loop, struct loop *father)
   cfun->max_loop_depth = MAX (cfun->max_loop_depth, (int) depth);
 
   VEC_truncate (loop_p, loop->superloops, 0);
-  VEC_reserve (loop_p, heap, loop->superloops, depth);
+  VEC_reserve (loop_p, gc, loop->superloops, depth);
   for (i = 0; VEC_iterate (loop_p, father->superloops, i, ploop); i++)
     VEC_quick_push (loop_p, loop->superloops, ploop);
   VEC_quick_push (loop_p, loop->superloops, father);
@@ -335,9 +337,11 @@ flow_loop_tree_node_remove (struct loop *loop)
 struct loop *
 alloc_loop (void)
 {
-  struct loop *loop = XCNEW (struct loop);
+  struct loop *loop = GGC_CNEW (struct loop);
+
+  loop->exits = GGC_CNEW (struct loop_exit);
+  loop->exits->next = loop->exits->prev = loop->exits;
 
-  loop->exits.next = loop->exits.prev = &loop->exits;
   return loop;
 }
 
@@ -417,7 +421,7 @@ flow_loops_find (struct loops *loops)
     }
 
   /* Allocate loop structures.  */
-  loops->larray = VEC_alloc (loop_p, heap, num_loops + 1);
+  loops->larray = VEC_alloc (loop_p, gc, num_loops + 1);
 
   /* Dummy loop containing whole function.  */
   root = alloc_loop ();
@@ -961,7 +965,7 @@ loop_exit_free (void *ex)
       exit->next->prev = exit->prev;
       exit->prev->next = exit->next;
 
-      free (exit);
+      ggc_free (exit);
     }
 }
 
@@ -1000,11 +1004,11 @@ rescan_loop_exit (edge e, bool new_edge, bool removed)
           aloop != cloop;
           aloop = loop_outer (aloop))
        {
-         exit = XNEW (struct loop_exit);
+         exit = GGC_NEW (struct loop_exit);
          exit->e = e;
 
-         exit->next = aloop->exits.next;
-         exit->prev = &aloop->exits;
+         exit->next = aloop->exits->next;
+         exit->prev = aloop->exits;
          exit->next->prev = exit;
          exit->prev->next = exit;
 
@@ -1050,10 +1054,11 @@ record_loop_exits (void)
   current_loops->state |= LOOPS_HAVE_RECORDED_EXITS;
 
   gcc_assert (current_loops->exits == NULL);
-  current_loops->exits = htab_create (2 * number_of_loops (),
-                                     loop_exit_hash,
-                                     loop_exit_eq,
-                                     loop_exit_free);
+  current_loops->exits = htab_create_alloc (2 * number_of_loops (),
+                                           loop_exit_hash,
+                                           loop_exit_eq,
+                                           loop_exit_free,
+                                           ggc_calloc, ggc_free);
 
   FOR_EACH_BB (bb)
     {
@@ -1123,7 +1128,7 @@ get_loop_exit_edges (const struct loop *loop)
      scan the body of the loop.  */
   if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
     {
-      for (exit = loop->exits.next; exit->e; exit = exit->next)
+      for (exit = loop->exits->next; exit->e; exit = exit->next)
        VEC_safe_push (edge, heap, edges, exit->e);
     }
   else
@@ -1441,7 +1446,7 @@ verify_loop_structure (void)
   /* Check the recorded loop exits.  */
   FOR_EACH_LOOP (li, loop, 0)
     {
-      if (loop->exits.e != NULL)
+      if (!loop->exits || loop->exits->e != NULL)
        {
          error ("corrupted head of the exits list of loop %d",
                 loop->num);
@@ -1451,7 +1456,7 @@ verify_loop_structure (void)
        {
          /* Check that the list forms a cycle, and all elements except
             for the head are nonnull.  */
-         for (mexit = &loop->exits, exit = mexit->next, i = 0;
+         for (mexit = loop->exits, exit = mexit->next, i = 0;
               exit->e && exit != mexit;
               exit = exit->next)
            {
@@ -1459,7 +1464,7 @@ verify_loop_structure (void)
                mexit = mexit->next;
            }
 
-         if (exit != &loop->exits)
+         if (exit != loop->exits)
            {
              error ("corrupted exits list of loop %d", loop->num);
              err = 1;
@@ -1468,7 +1473,7 @@ verify_loop_structure (void)
 
       if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
        {
-         if (loop->exits.next != &loop->exits)
+         if (loop->exits->next != loop->exits)
            {
              error ("nonempty exits list of loop %d, but exits are not recorded",
                     loop->num);
@@ -1530,7 +1535,7 @@ verify_loop_structure (void)
       FOR_EACH_LOOP (li, loop, 0)
        {
          eloops = 0;
-         for (exit = loop->exits.next; exit->e; exit = exit->next)
+         for (exit = loop->exits->next; exit->e; exit = exit->next)
            eloops++;
          if (eloops != sizes[loop->num])
            {
@@ -1585,12 +1590,12 @@ loop_exit_edge_p (const struct loop *loop, edge e)
 edge
 single_exit (const struct loop *loop)
 {
-  struct loop_exit *exit = loop->exits.next;
+  struct loop_exit *exit = loop->exits->next;
 
   if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
     return NULL;
 
-  if (exit->e && exit->next == &loop->exits)
+  if (exit->e && exit->next == loop->exits)
     return exit->e;
   else
     return NULL;
index 4c33c9cc056b6391d014276610d0e98fae413242..47892ea13da2b3a824b1a579ed429f20037ac5a3 100644 (file)
@@ -39,7 +39,7 @@ enum lpt_dec
   LPT_UNROLL_STUPID
 };
 
-struct lpt_decision
+struct lpt_decision GTY (())
 {
   enum lpt_dec decision;
   unsigned times;
@@ -47,7 +47,7 @@ struct lpt_decision
 
 /* The structure describing a bound on number of iterations of a loop.  */
 
-struct nb_iter_bound
+struct nb_iter_bound GTY ((chain_next ("%h.next")))
 {
   /* The statement STMT is executed at most ...  */
   tree stmt;
@@ -72,10 +72,10 @@ struct nb_iter_bound
 
 /* Description of the loop exit.  */
 
-struct loop_exit
+struct loop_exit GTY (())
 {
   /* The exit edge.  */
-  edge e;
+  struct edge_def *e;
 
   /* Previous and next exit in the list of the exits of the loop.  */
   struct loop_exit *prev;
@@ -88,18 +88,19 @@ struct loop_exit
 typedef struct loop *loop_p;
 DEF_VEC_P (loop_p);
 DEF_VEC_ALLOC_P (loop_p, heap);
+DEF_VEC_ALLOC_P (loop_p, gc);
 
 /* Structure to hold information for each natural loop.  */
-struct loop
+struct loop GTY ((chain_next ("%h.next")))
 {
   /* Index into loops array.  */
   int num;
 
   /* Basic block of loop header.  */
-  basic_block header;
+  struct basic_block_def *header;
 
   /* Basic block of loop latch.  */
-  basic_block latch;
+  struct basic_block_def *latch;
 
   /* For loop unrolling/peeling decision.  */
   struct lpt_decision lpt_decision;
@@ -114,7 +115,7 @@ struct loop
   unsigned num_nodes;
 
   /* Superloops of the loop, starting with the outermost loop.  */
-  VEC (loop_p, heap) *superloops;
+  VEC (loop_p, gc) *superloops;
 
   /* The first inner (child) loop or NULL if innermost loop.  */
   struct loop *inner;
@@ -126,7 +127,7 @@ struct loop
   struct loop *copy;
 
   /* Auxiliary info specific to a pass.  */
-  void *aux;
+  PTR GTY ((skip (""))) aux;
 
   /* The number of times the latch of the loop is executed.
      This is an INTEGER_CST or an expression containing symbolic
@@ -158,7 +159,7 @@ struct loop
   struct nb_iter_bound *bounds;
 
   /* Head of the cyclic list of the exits of the loop.  */
-  struct loop_exit exits;
+  struct loop_exit *exits;
 };
 
 /* Flags for state of loop structure.  */
@@ -177,18 +178,18 @@ enum
 #define AVOID_CFG_MODIFICATIONS (LOOPS_MAY_HAVE_MULTIPLE_LATCHES)
 
 /* Structure to hold CFG information about natural loops within a function.  */
-struct loops
+struct loops GTY (())
 {
   /* State of loops.  */
   int state;
 
   /* Array of the loops.  */
-  VEC (loop_p, heap) *larray;
+  VEC (loop_p, gc) *larray;
 
   /* Maps edges to the list of their descriptions as loop exits.  Edges
      whose sources or destinations have loop_father == NULL (which may
      happen during the cfg manipulations) should not appear in EXITS.  */
-  htab_t exits;
+  htab_t GTY((param_is (struct loop_exit))) exits;
 
   /* Pointer to root of loop hierarchy tree.  */
   struct loop *tree_root;
@@ -428,7 +429,7 @@ loop_outer (const struct loop *loop)
 
 /* Returns the list of loops in current_loops.  */
 
-static inline VEC (loop_p, heap) *
+static inline VEC (loop_p, gc) *
 get_loops (void)
 {
   if (!current_loops)
index a1af1111f1592ae97ff9f2432e5b5b713ad1e32d..4c658df876b729f96ff8d7123ecadeea6b46050d 100644 (file)
@@ -399,7 +399,7 @@ static void
 place_new_loop (struct loop *loop)
 {
   loop->num = number_of_loops ();
-  VEC_safe_push (loop_p, heap, current_loops->larray, loop);
+  VEC_safe_push (loop_p, gc, current_loops->larray, loop);
 }
 
 /* Given LOOP structure with filled header and latch, find the body of the
index a5afd1b8ddd879e44d57f5ad285087097933ea4c..c4faaf13df120d53241fdebdb76eeb0ffa76f50c 100644 (file)
@@ -191,7 +191,7 @@ struct function GTY(())
   struct gimple_df *gimple_df;
 
   /* The loops in this function.  */
-  struct loops * GTY((skip)) x_current_loops;
+  struct loops *x_current_loops;
 
   /* Value histograms attached to particular statements.  */
   htab_t GTY((skip)) value_histograms;
index 2728fabbeefae8edaba319176ffeb52ab5b2a013..54740211674830b49a96e76287e95e25c2b4c57b 100644 (file)
@@ -1535,7 +1535,7 @@ open_base_files (void)
       "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
       "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
       "tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
-      "cfglayout.h", "except.h", "output.h", NULL
+      "cfglayout.h", "except.h", "output.h", "cfgloop.h", NULL
     };
     const char *const *ifp;
     outf_p gtype_desc_c;
index f1c3df248d7f2767ac812d0b29129b201de1b497..3aa6527a80a804615c1f9149c24380bedd7105cf 100644 (file)
@@ -31,6 +31,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "tree-pass.h"
 #include "timevar.h"
 #include "flags.h"
+#include "ggc.h"
 
 \f
 /* Initialize loop structures.  This is used by the tree and RTL loop
@@ -43,7 +44,7 @@ loop_optimizer_init (unsigned flags)
   struct loops *loops;
 
   gcc_assert (!current_loops);
-  loops = XCNEW (struct loops);
+  loops = GGC_CNEW (struct loops);
 
   /* Find the loops.  */
 
@@ -116,7 +117,7 @@ loop_optimizer_finalize (void)
   if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
     release_recorded_exits ();
   flow_loops_free (current_loops);
-  free (current_loops);
+  ggc_free (current_loops);
   current_loops = NULL;
 
   FOR_ALL_BB (bb)
index 9fd5c786ebf45a256f84de92f27ca5d5c6b44d72..46831d7f5730f10977429df4cf5306dd31419a05 100644 (file)
@@ -258,7 +258,7 @@ static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
 /* The cached information about a ssa name VAR, claiming that inside LOOP,
    the value of VAR can be expressed as CHREC.  */
 
-struct scev_info_str
+struct scev_info_str GTY(())
 {
   tree var;
   tree chrec;
@@ -285,7 +285,7 @@ tree chrec_known;
 
 static bitmap already_instantiated;
 
-static htab_t scalar_evolution_info;
+static GTY ((param_is (struct scev_info_str))) htab_t scalar_evolution_info;
 
 \f
 /* Constructs a new SCEV_INFO_STR structure.  */
@@ -295,7 +295,7 @@ new_scev_info_str (tree var)
 {
   struct scev_info_str *res;
   
-  res = XNEW (struct scev_info_str);
+  res = GGC_NEW (struct scev_info_str);
   res->var = var;
   res->chrec = chrec_not_analyzed_yet;
   
@@ -326,7 +326,7 @@ eq_scev_info (const void *e1, const void *e2)
 static void
 del_scev_info (void *e)
 {
-  free (e);
+  ggc_free (e);
 }
 
 /* Get the index corresponding to VAR in the current LOOP.  If
@@ -2746,8 +2746,12 @@ scev_initialize (void)
   loop_iterator li;
   struct loop *loop;
 
-  scalar_evolution_info = htab_create (100, hash_scev_info,
-                                      eq_scev_info, del_scev_info);
+  scalar_evolution_info = htab_create_alloc (100,
+                                            hash_scev_info,
+                                            eq_scev_info,
+                                            del_scev_info,
+                                            ggc_calloc,
+                                            ggc_free);
   already_instantiated = BITMAP_ALLOC (NULL);
   
   initialize_scalar_evolutions_analyzer ();
@@ -3008,3 +3012,5 @@ scev_const_prop (void)
     }
   return 0;
 }
+
+#include "gt-tree-scalar-evolution.h"
index 814b23a78432430d729fdfdfbe39be7f97428532..301b6e340e65919d79b7fc459ad91747f6099e62 100644 (file)
@@ -2364,7 +2364,7 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
      list.  */
   if (upper)
     {
-      struct nb_iter_bound *elt = XNEW (struct nb_iter_bound);
+      struct nb_iter_bound *elt = GGC_NEW (struct nb_iter_bound);
 
       elt->bound = i_bound;
       elt->stmt = at_stmt;
@@ -3023,7 +3023,7 @@ free_numbers_of_iterations_estimates_loop (struct loop *loop)
   for (bound = loop->bounds; bound; bound = next)
     {
       next = bound->next;
-      free (bound);
+      ggc_free (bound);
     }
 
   loop->bounds = NULL;
index 7457e5396d9cba93e6fcf78fec70637fa20596e2..c5724cbcf86a194830dc8aad4f2651d0a043b7c3 100644 (file)
@@ -171,7 +171,8 @@ struct tree_opt_pass pass_tree_unswitch =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_verify_loops,  /* todo_flags_finish */
+  TODO_ggc_collect | TODO_dump_func
+    | TODO_verify_loops,               /* todo_flags_finish */
   0                                    /* letter */
 };
 
@@ -202,7 +203,8 @@ struct tree_opt_pass pass_vectorize =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   TODO_verify_loops,                   /* todo_flags_start */
-  TODO_dump_func | TODO_update_ssa,    /* todo_flags_finish */
+  TODO_dump_func | TODO_update_ssa
+    | TODO_ggc_collect,                        /* todo_flags_finish */
   0                                    /* letter */
 };
 
@@ -237,7 +239,8 @@ struct tree_opt_pass pass_linear_transform =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_verify_loops,  /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_loops
+    | TODO_ggc_collect,                        /* todo_flags_finish */
   0                                    /* letter */    
 };
 
@@ -361,7 +364,8 @@ struct tree_opt_pass pass_empty_loop =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_verify_loops,  /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_loops 
+    | TODO_ggc_collect,                        /* todo_flags_finish */
   0                                    /* letter */
 };
 
@@ -427,7 +431,8 @@ struct tree_opt_pass pass_complete_unroll =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_verify_loops,  /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_loops
+    | TODO_ggc_collect,                        /* todo_flags_finish */
   0                                    /* letter */
 };
 
@@ -496,9 +501,8 @@ struct tree_opt_pass pass_iv_optimize =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func
-  | TODO_verify_loops
-  | TODO_update_ssa,                   /* todo_flags_finish */
+  TODO_dump_func | TODO_verify_loops
+  | TODO_update_ssa | TODO_ggc_collect,        /* todo_flags_finish */
   0                                    /* letter */
 };