]> gcc.gnu.org Git - gcc.git/commitdiff
function.h (loops_for_fn): New inline function.
authorRichard Biener <rguenther@suse.de>
Tue, 30 Apr 2013 08:14:09 +0000 (08:14 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 30 Apr 2013 08:14:09 +0000 (08:14 +0000)
2013-04-30  Richard Biener  <rguenther@suse.de>

* function.h (loops_for_fn): New inline function.
(set_loops_for_fn): Likewise.
* cfgloop.h (place_new_loop): Add struct function parameter.
(get_loop): Likewise.
(get_loops): Likewise.
(number_of_loops): Likewise.
(fel_next): Adjust.
(fel_init): Likewise.
* cfg.c (get_loop_copy): Adjust.
* cfgloop.c (flow_loops_dump): Likewise.
(record_loop_exits): Likewise.
(verify_loop_structure): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Likewise.
(estimate_reg_pressure_cost): Likewise.
(mark_loop_exit_edges): Likewise.
* cfgloopmanip.c (place_new_loop): Likewise.
(add_loop): Likewise.
(duplicate_loop): Likewise.
* graph.c (draw_cfg_nodes): Likewise.
* graphite-clast-to-gimple.c (translate_clast_user): Likewise.
* graphite-sese-to-poly.c (build_scop_scattering): Likewise.
(extract_affine_chrec): Likewise.
(build_scop_iteration_domain): Likewise.
* graphite.c (graphite_initialize): Likewise.
* ira-build.c (create_loop_tree_nodes): Likewise.
(more_one_region_p): Likewise.
(rebuild_regno_allocno_maps): Likewise.
(mark_loops_for_removal): Likewise.
(mark_all_loops_for_removal): Likewise.
(remove_unnecessary_regions): Likewise.
(ira_build): Likewise.
* ira-emit.c (setup_entered_from_non_parent_p): Likewise.
* loop-init.c (fix_loop_structure): Likewise.
(gate_rtl_move_loop_invariants): Likewise.
(gate_rtl_unswitch): Likewise.
(gate_rtl_unroll_and_peel_loops): Likewise.
(rtl_doloop): Likewise.
* lto-streamer-in.c (input_cfg): Likewise.
* lto-streamer-out.c (output_cfg): Likewise.
* modulo-sched.c (sms_schedule): Likewise.
* predict.c (tree_estimate_probability): Likewise.
(tree_estimate_probability_driver): Likewise.
(estimate_loops): Likewise.
* tree-cfg.c (fixup_loop_arrays_after_move): Likewise.
(move_sese_region_to_fn): Likewise.
(debug_loop_num): Likewise.
* tree-chrec.c (chrec_evaluate): Likewise.
(hide_evolution_in_other_loops_than_loop): Likewise.
(chrec_component_in_loop_num): Likewise.
(reset_evolution_in_loop): Likewise.
(evolution_function_is_invariant_rec_p): Likewise.
* tree-if-conv.c (main_tree_if_conversion): Likewise.
* tree-inline.c (copy_loops): Likewise.
(copy_cfg_body): Likewise.
(tree_function_versioning): Likewise.
* tree-loop-distribution.c (rdg_flag_loop_exits): Likewise.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Likewise.
(add_to_evolution_1): Likewise.
(scev_const_prop): Likewise.
* tree-scalar-evolution.h (get_chrec_loop): Likewise.
* tree-ssa-loop-ch.c (copy_loop_headers): Likewise.
* tree-ssa-loop-im.c (analyze_memory_references): Likewise.
(tree_ssa_lim_initialize): Likewise.
* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Likewise.
(verify_loop_closed_ssa): Likewise.
* tree-ssa-loop.c  (tree_ssa_loop_init): Likewise.
(tree_ssa_loop_im): Likewise.
(tree_ssa_loop_unswitch): Likewise.
(tree_vectorize): Likewise.
(check_data_deps): Likewise.
(tree_ssa_loop_ivcanon): Likewise.
(tree_ssa_loop_bounds): Likewise.
(tree_complete_unroll): Likewise.
(tree_complete_unroll_inner): Likewise.
(tree_parallelize_loops): Likewise.
(tree_ssa_loop_prefetch): Likewise.
(tree_ssa_loop_ivopts): Likewise.
* tree-ssa.c (execute_update_addresses_taken): Liekwise.
* tree-vectorizer.c (vectorize_loops): Likewise.

From-SVN: r198441

31 files changed:
gcc/ChangeLog
gcc/cfg.c
gcc/cfgloop.c
gcc/cfgloop.h
gcc/cfgloopanal.c
gcc/cfgloopmanip.c
gcc/function.h
gcc/graph.c
gcc/graphite-clast-to-gimple.c
gcc/graphite-sese-to-poly.c
gcc/graphite.c
gcc/ira-build.c
gcc/ira-emit.c
gcc/loop-init.c
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/modulo-sched.c
gcc/predict.c
gcc/tree-cfg.c
gcc/tree-chrec.c
gcc/tree-if-conv.c
gcc/tree-inline.c
gcc/tree-loop-distribution.c
gcc/tree-scalar-evolution.c
gcc/tree-scalar-evolution.h
gcc/tree-ssa-loop-ch.c
gcc/tree-ssa-loop-im.c
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-loop.c
gcc/tree-ssa.c
gcc/tree-vectorizer.c

index ed8f71976049ff812ac9fae192b7b0bab1971587..62248a6e258d9521454adde918326f9f5d089fb1 100644 (file)
@@ -1,3 +1,86 @@
+2013-04-30  Richard Biener  <rguenther@suse.de>
+
+       * function.h (loops_for_fn): New inline function.
+       (set_loops_for_fn): Likewise.
+       * cfgloop.h (place_new_loop): Add struct function parameter.
+       (get_loop): Likewise.
+       (get_loops): Likewise.
+       (number_of_loops): Likewise.
+       (fel_next): Adjust.
+       (fel_init): Likewise.
+       * cfg.c (get_loop_copy): Adjust.
+       * cfgloop.c (flow_loops_dump): Likewise.
+       (record_loop_exits): Likewise.
+       (verify_loop_structure): Likewise.
+       * cfgloopanal.c (mark_irreducible_loops): Likewise.
+       (estimate_reg_pressure_cost): Likewise.
+       (mark_loop_exit_edges): Likewise.
+       * cfgloopmanip.c (place_new_loop): Likewise.
+       (add_loop): Likewise.
+       (duplicate_loop): Likewise.
+       * graph.c (draw_cfg_nodes): Likewise.
+       * graphite-clast-to-gimple.c (translate_clast_user): Likewise.
+       * graphite-sese-to-poly.c (build_scop_scattering): Likewise.
+       (extract_affine_chrec): Likewise.
+       (build_scop_iteration_domain): Likewise.
+       * graphite.c (graphite_initialize): Likewise.
+       * ira-build.c (create_loop_tree_nodes): Likewise.
+       (more_one_region_p): Likewise.
+       (rebuild_regno_allocno_maps): Likewise.
+       (mark_loops_for_removal): Likewise.
+       (mark_all_loops_for_removal): Likewise.
+       (remove_unnecessary_regions): Likewise.
+       (ira_build): Likewise.
+       * ira-emit.c (setup_entered_from_non_parent_p): Likewise.
+       * loop-init.c (fix_loop_structure): Likewise.
+       (gate_rtl_move_loop_invariants): Likewise.
+       (gate_rtl_unswitch): Likewise.
+       (gate_rtl_unroll_and_peel_loops): Likewise.
+       (rtl_doloop): Likewise.
+       * lto-streamer-in.c (input_cfg): Likewise.
+       * lto-streamer-out.c (output_cfg): Likewise.
+       * modulo-sched.c (sms_schedule): Likewise.
+       * predict.c (tree_estimate_probability): Likewise.
+       (tree_estimate_probability_driver): Likewise.
+       (estimate_loops): Likewise.
+       * tree-cfg.c (fixup_loop_arrays_after_move): Likewise.
+       (move_sese_region_to_fn): Likewise.
+       (debug_loop_num): Likewise.
+       * tree-chrec.c (chrec_evaluate): Likewise.
+       (hide_evolution_in_other_loops_than_loop): Likewise.
+       (chrec_component_in_loop_num): Likewise.
+       (reset_evolution_in_loop): Likewise.
+       (evolution_function_is_invariant_rec_p): Likewise.
+       * tree-if-conv.c (main_tree_if_conversion): Likewise.
+       * tree-inline.c (copy_loops): Likewise.
+       (copy_cfg_body): Likewise.
+       (tree_function_versioning): Likewise.
+       * tree-loop-distribution.c (rdg_flag_loop_exits): Likewise.
+       * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
+       Likewise.
+       (add_to_evolution_1): Likewise.
+       (scev_const_prop): Likewise.
+       * tree-scalar-evolution.h (get_chrec_loop): Likewise.
+       * tree-ssa-loop-ch.c (copy_loop_headers): Likewise.
+       * tree-ssa-loop-im.c (analyze_memory_references): Likewise.
+       (tree_ssa_lim_initialize): Likewise.
+       * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Likewise.
+       (verify_loop_closed_ssa): Likewise.
+       * tree-ssa-loop.c  (tree_ssa_loop_init): Likewise.
+       (tree_ssa_loop_im): Likewise.
+       (tree_ssa_loop_unswitch): Likewise.
+       (tree_vectorize): Likewise.
+       (check_data_deps): Likewise.
+       (tree_ssa_loop_ivcanon): Likewise.
+       (tree_ssa_loop_bounds): Likewise.
+       (tree_complete_unroll): Likewise.
+       (tree_complete_unroll_inner): Likewise.
+       (tree_parallelize_loops): Likewise.
+       (tree_ssa_loop_prefetch): Likewise.
+       (tree_ssa_loop_ivopts): Likewise.
+       * tree-ssa.c (execute_update_addresses_taken): Liekwise.
+       * tree-vectorizer.c (vectorize_loops): Likewise.
+
 2013-04-29  Mike Frysinger  <vapier@gentoo.org>
 
        * config/arm/bpabi.h (EABI_LINK_SPEC): Define.
index 2bcd790d306a88e6524ef705e4f837425d3c12d7..6405f93f429ba16ee42bd5edbb303160b3d0da9a 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -1180,7 +1180,7 @@ get_loop_copy (struct loop *loop)
   key.index1 = loop->num;
   entry = loop_copy.find (&key);
   if (entry)
-    return get_loop (entry->index2);
+    return get_loop (cfun, entry->index2);
   else
     return NULL;
 }
index 28b63ae2f36a12f221214c6b9ccf44b934a154b6..01287246c330c2ecd97858aa99a43ce60e949222 100644 (file)
@@ -160,7 +160,7 @@ flow_loops_dump (FILE *file, void (*loop_dump_aux) (const struct loop *, FILE *,
   if (!current_loops || ! file)
     return;
 
-  fprintf (file, ";; %d loops found\n", number_of_loops ());
+  fprintf (file, ";; %d loops found\n", number_of_loops (cfun));
 
   FOR_EACH_LOOP (li, loop, LI_INCLUDE_ROOT)
     {
@@ -1077,7 +1077,7 @@ record_loop_exits (void)
   loops_state_set (LOOPS_HAVE_RECORDED_EXITS);
 
   gcc_assert (current_loops->exits == NULL);
-  current_loops->exits = htab_create_ggc (2 * number_of_loops (),
+  current_loops->exits = htab_create_ggc (2 * number_of_loops (cfun),
                                          loop_exit_hash, loop_exit_eq,
                                          loop_exit_free);
 
@@ -1324,7 +1324,7 @@ verify_loop_structure (void)
   struct loop *loop;
   int err = 0;
   edge e;
-  unsigned num = number_of_loops ();
+  unsigned num = number_of_loops (cfun);
   loop_iterator li;
   struct loop_exit *exit, *mexit;
   bool dom_available = dom_info_available_p (CDI_DOMINATORS);
index 5c38599cc6c883538fa02b421dbc06e0df40bbce..0f24799663057467a96e7eea840dbccab33b445f 100644 (file)
@@ -234,7 +234,7 @@ void rescan_loop_exit (edge, bool, bool);
 /* Loop data structure manipulation/querying.  */
 extern void flow_loop_tree_node_add (struct loop *, struct loop *);
 extern void flow_loop_tree_node_remove (struct loop *);
-extern void place_new_loop (struct loop *);
+extern void place_new_loop (struct function *, struct loop *);
 extern void add_loop (struct loop *, struct loop *);
 extern bool flow_loop_nested_p (const struct loop *, const struct loop *);
 extern bool flow_bb_inside_loop_p (const struct loop *, const_basic_block);
@@ -436,12 +436,12 @@ simple_loop_desc (struct loop *loop)
 
 /* Accessors for the loop structures.  */
 
-/* Returns the loop with index NUM from current_loops.  */
+/* Returns the loop with index NUM from FNs loop tree.  */
 
 static inline struct loop *
-get_loop (unsigned num)
+get_loop (struct function *fn, unsigned num)
 {
-  return (*current_loops->larray)[num];
+  return (*loops_for_fn (fn)->larray)[num];
 }
 
 /* Returns the number of superloops of LOOP.  */
@@ -482,27 +482,29 @@ loop_has_exit_edges (const struct loop *loop)
   return loop->exits->next->e != NULL;
 }
 
-/* Returns the list of loops in current_loops.  */
+/* Returns the list of loops in FN.  */
 
-static inline vec<loop_p, va_gc> *
-get_loops (void)
+inline vec<loop_p, va_gc> *
+get_loops (struct function *fn)
 {
-  if (!current_loops)
+  struct loops *loops = loops_for_fn (fn);
+  if (!loops)
     return NULL;
 
-  return current_loops->larray;
+  return loops->larray;
 }
 
-/* Returns the number of loops in current_loops (including the removed
+/* Returns the number of loops in FN (including the removed
    ones and the fake loop that forms the root of the loop tree).  */
 
 static inline unsigned
-number_of_loops (void)
+number_of_loops (struct function *fn)
 {
-  if (!current_loops)
+  struct loops *loops = loops_for_fn (fn);
+  if (!fn)
     return 0;
 
-  return vec_safe_length (current_loops->larray);
+  return vec_safe_length (loops->larray);
 }
 
 /* Returns true if state of the loops satisfies all properties
@@ -563,7 +565,7 @@ fel_next (loop_iterator *li, loop_p *loop)
   while (li->to_visit.iterate (li->idx, &anum))
     {
       li->idx++;
-      *loop = get_loop (anum);
+      *loop = get_loop (cfun, anum);
       if (*loop)
        return;
     }
@@ -587,7 +589,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
       return;
     }
 
-  li->to_visit.create (number_of_loops ());
+  li->to_visit.create (number_of_loops (cfun));
   mn = (flags & LI_INCLUDE_ROOT) ? 0 : 1;
 
   if (flags & LI_ONLY_INNERMOST)
index b41701b8293d0a5f1e5a4a528123fa45f59cbe8d..9300237c670020ad69b391239173b94a064c9cae 100644 (file)
@@ -77,7 +77,7 @@ mark_irreducible_loops (void)
   int src, dest;
   unsigned depth;
   struct graph *g;
-  int num = number_of_loops ();
+  int num = number_of_loops (cfun);
   struct loop *cloop;
   bool irred_loop_found = false;
   int i;
@@ -409,7 +409,7 @@ estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed,
 
   if (optimize && (flag_ira_region == IRA_REGION_ALL
                   || flag_ira_region == IRA_REGION_MIXED)
-      && number_of_loops () <= (unsigned) IRA_MAX_LOOPS_NUM)
+      && number_of_loops (cfun) <= (unsigned) IRA_MAX_LOOPS_NUM)
     /* IRA regional allocation deals with high register pressure
        better.  So decrease the cost (to do more accurate the cost
        calculation for IRA, we need to know how many registers lives
@@ -427,7 +427,7 @@ mark_loop_exit_edges (void)
   basic_block bb;
   edge e;
 
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return;
 
   FOR_EACH_BB (bb)
index f2d6a3b7050490a694cbf4483b02d067d5ed5c27..9581677da9f147fbde9ee0431230258edc9a89d0 100644 (file)
@@ -408,13 +408,13 @@ remove_path (edge e)
   return true;
 }
 
-/* Creates place for a new LOOP in loops structure.  */
+/* Creates place for a new LOOP in loops structure of FN.  */
 
 void
-place_new_loop (struct loop *loop)
+place_new_loop (struct function *fn, struct loop *loop)
 {
-  loop->num = number_of_loops ();
-  vec_safe_push (current_loops->larray, loop);
+  loop->num = number_of_loops (fn);
+  vec_safe_push (loops_for_fn (fn)->larray, loop);
 }
 
 /* Given LOOP structure with filled header and latch, find the body of the
@@ -431,7 +431,7 @@ add_loop (struct loop *loop, struct loop *outer)
   edge_iterator ei;
 
   /* Add it to loop structure.  */
-  place_new_loop (loop);
+  place_new_loop (cfun, loop);
   flow_loop_tree_node_add (outer, loop);
 
   /* Find its nodes.  */
@@ -1010,7 +1010,7 @@ duplicate_loop (struct loop *loop, struct loop *target)
 {
   struct loop *cloop;
   cloop = alloc_loop ();
-  place_new_loop (cloop);
+  place_new_loop (cfun, cloop);
  
   copy_loop_info (loop, cloop);
 
index 89d71e592dd227e52422dc4249037fac54e6d346..c0e42d3c39c27573c0a59c26507162f996305f73 100644 (file)
@@ -700,6 +700,23 @@ extern void push_cfun (struct function *new_cfun);
 extern void pop_cfun (void);
 extern void instantiate_decl_rtl (rtx x);
 
+/* Return the loop tree of FN.  */
+
+inline struct loops *
+loops_for_fn (struct function *fn)
+{
+  return fn->x_current_loops;
+}
+
+/* Set the loop tree of FN to LOOPS.  */
+
+inline void
+set_loops_for_fn (struct function *fn, struct loops *loops)
+{
+  gcc_checking_assert (fn->x_current_loops == NULL || loops == NULL);
+  fn->x_current_loops = loops;
+}
+
 /* For backward compatibility... eventually these should all go away.  */
 #define current_function_funcdef_no (cfun->funcdef_no)
 
index 6aebb22afff1e90f355623920d502101b8d11b20..97930d0fabe954a36cb2a5faa445aedb70f14ac6 100644 (file)
@@ -258,10 +258,8 @@ draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no,
 static void
 draw_cfg_nodes (pretty_printer *pp, struct function *fun)
 {
-  /* ??? This x_current_loops should be enapsulated.  */
-  if (fun->x_current_loops)
-    draw_cfg_nodes_for_loop (pp, fun->funcdef_no,
-                            fun->x_current_loops->tree_root);
+  if (loops_for_fn (fun))
+    draw_cfg_nodes_for_loop (pp, fun->funcdef_no, get_loop (fun, 0));
   else
     draw_cfg_nodes_no_loops (pp, fun);
 }
index dcf8b94eaa1e524680b9c893b056687bda36e390..82cae2fe4b8b731b567f403a25c636ba1efa967b 100644 (file)
@@ -1094,7 +1094,7 @@ translate_clast_user (struct clast_user_stmt *stmt, edge next_e,
   if (GBB_BB (gbb) == ENTRY_BLOCK_PTR)
     return next_e;
 
-  nb_loops = number_of_loops ();
+  nb_loops = number_of_loops (cfun);
   iv_map.create (nb_loops);
   for (i = 0; i < nb_loops; i++)
     iv_map.quick_push (NULL_TREE);
index 34057e948dafc65e5c3fcb91413031b04ba2f986..c4c3eb40449f7f34187b592fd5a2b5aa87778217 100644 (file)
@@ -550,7 +550,7 @@ build_scop_scattering (scop_p scop)
   isl_space *dc = isl_set_get_space (scop->context);
   isl_aff *static_sched;
 
-  dc = isl_space_add_dims (dc, isl_dim_set, number_of_loops());
+  dc = isl_space_add_dims (dc, isl_dim_set, number_of_loops (cfun));
   static_sched = isl_aff_zero_on_domain (isl_local_space_from_space (dc));
 
   /* We have to start schedules at 0 on the first component and
@@ -590,8 +590,7 @@ extract_affine_chrec (scop_p s, tree e, __isl_take isl_space *space)
   isl_pw_aff *lhs = extract_affine (s, CHREC_LEFT (e), isl_space_copy (space));
   isl_pw_aff *rhs = extract_affine (s, CHREC_RIGHT (e), isl_space_copy (space));
   isl_local_space *ls = isl_local_space_from_space (space);
-  unsigned pos = sese_loop_depth ((sese) s->region,
-                                 get_loop (CHREC_VARIABLE (e))) - 1;
+  unsigned pos = sese_loop_depth ((sese) s->region, get_chrec_loop (e)) - 1;
   isl_aff *loop = isl_aff_set_coefficient_si
     (isl_aff_zero_on_domain (ls), isl_dim_in, pos, 1);
   isl_pw_aff *l = isl_pw_aff_from_aff (loop);
@@ -1404,7 +1403,7 @@ build_scop_iteration_domain (scop_p scop)
   sese region = SCOP_REGION (scop);
   int i;
   poly_bb_p pbb;
-  int nb_loops = number_of_loops ();
+  int nb_loops = number_of_loops (cfun);
   isl_set **doms = XCNEWVEC (isl_set *, nb_loops);
 
   FOR_EACH_VEC_ELT (SESE_LOOP_NEST (region), i, loop)
index 10d1dd510c97c96a110c46b6600ea776dd4f827d..f953663941226006186a4b2c2f798cff959ab4d1 100644 (file)
@@ -198,7 +198,7 @@ print_graphite_statistics (FILE* file, vec<scop_p> scops)
 static bool
 graphite_initialize (isl_ctx *ctx)
 {
-  if (number_of_loops () <= 1
+  if (number_of_loops (cfun) <= 1
       /* FIXME: This limit on the number of basic blocks of a function
         should be removed when the SCOP detection is faster.  */
       || n_basic_blocks > PARAM_VALUE (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION))
index 70be92174a4066b0d568b1151083a14876764635..0e2fd0c551073ba52205830698a5c752ebb7a98c 100644 (file)
@@ -151,11 +151,11 @@ create_loop_tree_nodes (void)
       init_loop_tree_node (ira_loop_nodes, 0);
       return;
     }
-  ira_loop_nodes_count = number_of_loops ();
+  ira_loop_nodes_count = number_of_loops (cfun);
   ira_loop_nodes = ((struct ira_loop_tree_node *)
                    ira_allocate (sizeof (struct ira_loop_tree_node)
                                  * ira_loop_nodes_count));
-  FOR_EACH_VEC_SAFE_ELT (get_loops (), i, loop)
+  FOR_EACH_VEC_SAFE_ELT (get_loops (cfun), i, loop)
     {
       if (loop_outer (loop) != NULL)
        {
@@ -194,7 +194,7 @@ more_one_region_p (void)
   loop_p loop;
 
   if (current_loops != NULL)
-    FOR_EACH_VEC_SAFE_ELT (get_loops (), i, loop)
+    FOR_EACH_VEC_SAFE_ELT (get_loops (cfun), i, loop)
       if (ira_loop_nodes[i].regno_allocno_map != NULL
          && ira_loop_tree_root != &ira_loop_nodes[i])
        return true;
@@ -379,7 +379,7 @@ rebuild_regno_allocno_maps (void)
 
   ira_assert (current_loops != NULL);
   max_regno = max_reg_num ();
-  FOR_EACH_VEC_SAFE_ELT (get_loops (), l, loop)
+  FOR_EACH_VEC_SAFE_ELT (get_loops (cfun), l, loop)
     if (ira_loop_nodes[l].regno_allocno_map != NULL)
       {
        ira_free (ira_loop_nodes[l].regno_allocno_map);
@@ -2053,8 +2053,8 @@ mark_loops_for_removal (void)
   ira_assert (current_loops != NULL);
   sorted_loops
     = (ira_loop_tree_node_t *) ira_allocate (sizeof (ira_loop_tree_node_t)
-                                            * number_of_loops ());
-  for (n = i = 0; vec_safe_iterate (get_loops (), i, &loop); i++)
+                                            * number_of_loops (cfun));
+  for (n = i = 0; vec_safe_iterate (get_loops (cfun), i, &loop); i++)
     if (ira_loop_nodes[i].regno_allocno_map != NULL)
       {
        if (ira_loop_nodes[i].parent == NULL)
@@ -2098,7 +2098,7 @@ mark_all_loops_for_removal (void)
   loop_p loop;
 
   ira_assert (current_loops != NULL);
-  FOR_EACH_VEC_SAFE_ELT (get_loops (), i, loop)
+  FOR_EACH_VEC_SAFE_ELT (get_loops (cfun), i, loop)
     if (ira_loop_nodes[i].regno_allocno_map != NULL)
       {
        if (ira_loop_nodes[i].parent == NULL)
@@ -2408,8 +2408,8 @@ remove_unnecessary_regions (bool all_p)
     mark_all_loops_for_removal ();
   else
     mark_loops_for_removal ();
-  children_vec.create(last_basic_block + number_of_loops ());
-  removed_loop_vec.create(last_basic_block + number_of_loops ());
+  children_vec.create(last_basic_block + number_of_loops (cfun));
+  removed_loop_vec.create(last_basic_block + number_of_loops (cfun));
   remove_uneccesary_loop_nodes_from_loop_tree (ira_loop_tree_root);
   children_vec.release ();
   if (all_p)
@@ -3290,7 +3290,7 @@ ira_build (void)
            }
        }
       fprintf (ira_dump_file, "  regions=%d, blocks=%d, points=%d\n",
-              current_loops == NULL ? 1 : number_of_loops (),
+              current_loops == NULL ? 1 : number_of_loops (cfun),
               n_basic_blocks, ira_max_point);
       fprintf (ira_dump_file,
               "    allocnos=%d (big %d), copies=%d, conflicts=%d, ranges=%d\n",
index c18391fc3e5d73a511781a5f86d65597f893c72f..cdd694176aa41c4d6b19411d3439c394a70f0397 100644 (file)
@@ -434,7 +434,7 @@ setup_entered_from_non_parent_p (void)
   loop_p loop;
 
   ira_assert (current_loops != NULL);
-  FOR_EACH_VEC_SAFE_ELT (get_loops (), i, loop)
+  FOR_EACH_VEC_SAFE_ELT (get_loops (cfun), i, loop)
     if (ira_loop_nodes[i].regno_allocno_map != NULL)
       ira_loop_nodes[i].entered_from_non_parent_p
        = entered_from_non_parent_p (&ira_loop_nodes[i]);
index 1f605c9760622bbfc1ec4e993b0c0bfad3d8d314..65f9c6c9d4a1fd9915bdd3cc36956a017898afef 100644 (file)
@@ -251,7 +251,7 @@ fix_loop_structure (bitmap changed_bbs)
 
   /* Remember the number of loops so we can return how many new loops
      flow_loops_find discovered.  */
-  old_nloops = number_of_loops ();
+  old_nloops = number_of_loops (cfun);
 
   /* Re-compute loop structure in-place.  */
   flow_loops_find (current_loops);
@@ -269,10 +269,10 @@ fix_loop_structure (bitmap changed_bbs)
     }
 
   /* Finally free deleted loops.  */
-  FOR_EACH_VEC_ELT (*get_loops (), i, loop)
+  FOR_EACH_VEC_ELT (*get_loops (cfun), i, loop)
     if (loop && loop->header == NULL)
       {
-       (*get_loops ())[i] = NULL;
+       (*get_loops (cfun))[i] = NULL;
        flow_loop_free (loop);
       }
 
@@ -287,7 +287,7 @@ fix_loop_structure (bitmap changed_bbs)
 
   timevar_pop (TV_LOOP_INIT);
 
-  return number_of_loops () - old_nloops;
+  return number_of_loops (cfun) - old_nloops;
 }
 \f
 /* Gate for the RTL loop superpass.  The actual passes are subpasses.
@@ -426,7 +426,7 @@ gate_rtl_move_loop_invariants (void)
 static unsigned int
 rtl_move_loop_invariants (void)
 {
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     move_loop_invariants ();
   return 0;
 }
@@ -463,7 +463,7 @@ gate_rtl_unswitch (void)
 static unsigned int
 rtl_unswitch (void)
 {
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     unswitch_loops ();
   return 0;
 }
@@ -499,7 +499,7 @@ gate_rtl_unroll_and_peel_loops (void)
 static unsigned int
 rtl_unroll_and_peel_loops (void)
 {
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     {
       int flags = 0;
       if (dump_file)
@@ -553,7 +553,7 @@ static unsigned int
 rtl_doloop (void)
 {
 #ifdef HAVE_doloop_end
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     doloop_optimize_loops ();
 #endif
   return 0;
index 87158bf0b33a704e27eb8a26716508c54b1b5b82..02889a99501144b29c94a625c3918928e14776a8 100644 (file)
@@ -673,6 +673,7 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
 
   struct loops *loops = ggc_alloc_cleared_loops ();
   init_loops_structure (fn, loops, n_loops);
+  set_loops_for_fn (fn, loops);
 
   /* Input each loop and associate it with its loop header so
      flow_loops_find can rebuild the loop tree.  */
@@ -686,7 +687,6 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
        }
 
       struct loop *loop = alloc_loop ();
-      loop->num = loops->larray->length ();
       loop->header = BASIC_BLOCK_FOR_FUNCTION (fn, header_index);
       loop->header->loop_father = loop;
 
@@ -705,7 +705,7 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
          loop->nb_iterations_estimate.high = streamer_read_hwi (ib);
        }
 
-      loops->larray->quick_push (loop);
+      place_new_loop (fn, loop);
 
       /* flow_loops_find doesn't like loops not in the tree, hook them
          all as siblings of the tree root temporarily.  */
@@ -713,7 +713,7 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
     }
 
   /* Rebuild the loop tree.  */
-  fn->x_current_loops = flow_loops_find (loops);
+  flow_loops_find (loops);
 }
 
 
index 110cc3e580a8c75388d8e4c88525bfa721251d92..dfaf2806b7471d9973436f3df7d6a0205879bc08 100644 (file)
@@ -664,12 +664,12 @@ output_cfg (struct output_block *ob, struct function *fn)
   gcc_assert (cfun == fn);
 
   /* Output the number of loops.  */
-  streamer_write_uhwi (ob, number_of_loops ());
+  streamer_write_uhwi (ob, number_of_loops (fn));
 
   /* Output each loop, skipping the tree root which has number zero.  */
-  for (unsigned i = 1; i < number_of_loops (); ++i)
+  for (unsigned i = 1; i < number_of_loops (fn); ++i)
     {
-      struct loop *loop = get_loop (i);
+      struct loop *loop = get_loop (fn, i);
 
       /* Write the index of the loop header.  That's enough to rebuild
          the loop tree on the reader side.  Stream -1 for an unused
index 6ce79a96f6edc5f3b38c094f9bd2b74df00d550d..1e9b16c6fcb230689c190c7931f489d91077a079 100644 (file)
@@ -1360,7 +1360,7 @@ sms_schedule (void)
 
   loop_optimizer_init (LOOPS_HAVE_PREHEADERS
                       | LOOPS_HAVE_RECORDED_EXITS);
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     {
       loop_optimizer_finalize ();
       return;  /* There are no loops to schedule.  */
@@ -1384,7 +1384,7 @@ sms_schedule (void)
 
   /* Allocate memory to hold the DDG array one entry for each loop.
      We use loop->num as index into this array.  */
-  g_arr = XCNEWVEC (ddg_ptr, number_of_loops ());
+  g_arr = XCNEWVEC (ddg_ptr, number_of_loops (cfun));
 
   if (dump_file)
   {
index b6786f7c51696493cf00105bb2154873cf1aa750..9a15c87dac9f2f83a21a73f6e8bc901b39175a10 100644 (file)
@@ -2338,7 +2338,7 @@ tree_estimate_probability (void)
   tree_bb_level_predictions ();
   record_loop_exits ();
 
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     predict_loops ();
 
   FOR_EACH_BB (bb)
@@ -2372,7 +2372,7 @@ tree_estimate_probability_driver (void)
 
   mark_irreducible_loops ();
 
-  nb_loops = number_of_loops ();
+  nb_loops = number_of_loops (cfun);
   if (nb_loops > 1)
     scev_initialize ();
 
@@ -2694,7 +2694,7 @@ estimate_loops (void)
   basic_block bb;
 
   /* Start by estimating the frequencies in the loops.  */
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     estimate_loops_at_level (current_loops->tree_root->inner);
 
   /* Now propagate the frequencies through all the blocks.  */
index 9b00248ece6ef6ff6e0dada79f7a4aee8cb47547..798a2f74057b21c9642b9153c8628dbea3765394 100644 (file)
@@ -6586,11 +6586,11 @@ fixup_loop_arrays_after_move (struct function *fn1, struct function *fn2,
                              struct loop *loop)
 {
   /* Discard it from the old loop array.  */
-  (*fn1->x_current_loops->larray)[loop->num] = NULL;
+  (*get_loops (fn1))[loop->num] = NULL;
 
   /* Place it in the new loop array, assigning it a new number.  */
-  loop->num = vec_safe_length (fn2->x_current_loops->larray);
-  vec_safe_push (fn2->x_current_loops->larray, loop);
+  loop->num = number_of_loops (fn2);
+  vec_safe_push (loops_for_fn (fn2)->larray, loop);
 
   /* Recurse to children.  */
   for (loop = loop->inner; loop; loop = loop->next)
@@ -6717,9 +6717,10 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
     }
 
   /* Initialize an empty loop tree.  */
-  dest_cfun->x_current_loops = ggc_alloc_cleared_loops ();
-  init_loops_structure (dest_cfun, dest_cfun->x_current_loops, 1);
-  dest_cfun->x_current_loops->state = LOOPS_MAY_HAVE_MULTIPLE_LATCHES;
+  struct loops *loops = ggc_alloc_cleared_loops ();
+  init_loops_structure (dest_cfun, loops, 1);
+  loops->state = LOOPS_MAY_HAVE_MULTIPLE_LATCHES;
+  set_loops_for_fn (dest_cfun, loops);
 
   /* Move the outlined loop tree part.  */
   FOR_EACH_VEC_ELT (bbs, i, bb)
@@ -6729,25 +6730,25 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
        {
          struct loop *loop = bb->loop_father;
          flow_loop_tree_node_remove (bb->loop_father);
-         flow_loop_tree_node_add (dest_cfun->x_current_loops->tree_root, loop);
+         flow_loop_tree_node_add (get_loop (dest_cfun, 0), loop);
          fixup_loop_arrays_after_move (saved_cfun, cfun, loop);
        }
 
       /* Remove loop exits from the outlined region.  */
-      if (saved_cfun->x_current_loops->exits)
+      if (loops_for_fn (saved_cfun)->exits)
        FOR_EACH_EDGE (e, ei, bb->succs)
          {
            void **slot = htab_find_slot_with_hash
-               (saved_cfun->x_current_loops->exits, e,
+               (loops_for_fn (saved_cfun)->exits, e,
                 htab_hash_pointer (e), NO_INSERT);
            if (slot)
-             htab_clear_slot (saved_cfun->x_current_loops->exits, slot);
+             htab_clear_slot (loops_for_fn (saved_cfun)->exits, slot);
          }
     }
 
 
   /* Adjust the number of blocks in the tree root of the outlined part.  */
-  dest_cfun->x_current_loops->tree_root->num_nodes = bbs.length () + 2;
+  get_loop (dest_cfun, 0)->num_nodes = bbs.length () + 2;
 
   /* Setup a mapping to be used by move_block_to_fn.  */
   loop->aux = current_loops->tree_root;
@@ -7226,7 +7227,7 @@ debug_loop (struct loop *loop, int verbosity)
 DEBUG_FUNCTION void
 debug_loop_num (unsigned num, int verbosity)
 {
-  debug_loop (get_loop (num), verbosity);
+  debug_loop (get_loop (cfun, num), verbosity);
 }
 
 /* Return true if BB ends with a call, possibly followed by some
index ca31a9d065c0ab9729d938dc690f073589d56126..c18ccd3f9333d750742fc16bf334bb970dc407e1 100644 (file)
@@ -517,7 +517,7 @@ chrec_evaluate (unsigned var, tree chrec, tree n, unsigned int k)
 {
   tree arg0, arg1, binomial_n_k;
   tree type = TREE_TYPE (chrec);
-  struct loop *var_loop = get_loop (var);
+  struct loop *var_loop = get_loop (cfun, var);
 
   while (TREE_CODE (chrec) == POLYNOMIAL_CHREC
         && flow_loop_nested_p (var_loop, get_chrec_loop (chrec)))
@@ -690,7 +690,7 @@ tree
 hide_evolution_in_other_loops_than_loop (tree chrec,
                                         unsigned loop_num)
 {
-  struct loop *loop = get_loop (loop_num), *chloop;
+  struct loop *loop = get_loop (cfun, loop_num), *chloop;
   if (automatically_generated_chrec_p (chrec))
     return chrec;
 
@@ -731,7 +731,7 @@ chrec_component_in_loop_num (tree chrec,
                             bool right)
 {
   tree component;
-  struct loop *loop = get_loop (loop_num), *chloop;
+  struct loop *loop = get_loop (cfun, loop_num), *chloop;
 
   if (automatically_generated_chrec_p (chrec))
     return chrec;
@@ -813,7 +813,7 @@ reset_evolution_in_loop (unsigned loop_num,
                         tree chrec,
                         tree new_evol)
 {
-  struct loop *loop = get_loop (loop_num);
+  struct loop *loop = get_loop (cfun, loop_num);
 
   if (POINTER_TYPE_P (chrec_type (chrec)))
     gcc_assert (ptrofftype_p (chrec_type (new_evol)));
@@ -986,14 +986,14 @@ evolution_function_is_invariant_rec_p (tree chrec, int loopnum)
 
   if (TREE_CODE (chrec) == SSA_NAME
       && (loopnum == 0
-         || expr_invariant_in_loop_p (get_loop (loopnum), chrec)))
+         || expr_invariant_in_loop_p (get_loop (cfun, loopnum), chrec)))
     return true;
 
   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
     {
       if (CHREC_VARIABLE (chrec) == (unsigned) loopnum
-         || flow_loop_nested_p (get_loop (loopnum),
-                                get_loop (CHREC_VARIABLE (chrec)))
+         || flow_loop_nested_p (get_loop (cfun, loopnum),
+                                get_chrec_loop (chrec))
          || !evolution_function_is_invariant_rec_p (CHREC_RIGHT (chrec),
                                                     loopnum)
          || !evolution_function_is_invariant_rec_p (CHREC_LEFT (chrec),
index 95d0394fc51d4cfd582dec119c97e39ae5b59bd1..0ebb8c36cea7e833cf621bfa307a82f521bc3c56 100644 (file)
@@ -1818,7 +1818,7 @@ main_tree_if_conversion (void)
   bool changed = false;
   unsigned todo = 0;
 
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   FOR_EACH_LOOP (li, loop, 0)
index 35cdb787538c4af650b315a5e1c868d0b8d1ea9f..3abaadc5d2e153510ea6c1863c821c3158c92b80 100644 (file)
@@ -2223,7 +2223,7 @@ copy_loops (bitmap blocks_to_copy,
          copy_loop_info (src_loop, dest_loop);
 
          /* Finally place it into the loop array and the loop tree.  */
-         place_new_loop (dest_loop);
+         place_new_loop (cfun, dest_loop);
          flow_loop_tree_node_add (dest_parent, dest_loop);
 
          /* Recurse.  */
@@ -2332,11 +2332,11 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
     }
 
   /* Duplicate the loop tree, if available and wanted.  */
-  if (id->src_cfun->x_current_loops != NULL
+  if (loops_for_fn (src_cfun) != NULL
       && current_loops != NULL)
     {
       copy_loops (blocks_to_copy, entry_block_map->loop_father,
-                 id->src_cfun->x_current_loops->tree_root);
+                 get_loop (src_cfun, 0));
       /* Defer to cfgcleanup to update loop-father fields of basic-blocks.  */
       loops_state_set (LOOPS_NEED_FIXUP);
     }
@@ -5199,7 +5199,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
     }
 
   /* Set up the destination functions loop tree.  */
-  if (DECL_STRUCT_FUNCTION (old_decl)->x_current_loops)
+  if (loops_for_fn (DECL_STRUCT_FUNCTION (old_decl)) != NULL)
     {
       cfun->curr_properties &= ~PROP_loops;
       loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
index 5c2c7db44004b888d7c2dcea4b5b76a89babe0ab..13b78cc37d2f713c4d219d158d103f938e30c5e0 100644 (file)
@@ -774,7 +774,7 @@ rdg_flag_loop_exits (struct graph *rdg, bitmap loops, partition_t partition,
   conds.create (3);
 
   EXECUTE_IF_SET_IN_BITMAP (loops, 0, i, bi)
-    collect_condition_stmts (get_loop (i), &conds);
+    collect_condition_stmts (get_loop (cfun, i), &conds);
 
   while (!conds.is_empty ())
     {
@@ -787,7 +787,7 @@ rdg_flag_loop_exits (struct graph *rdg, bitmap loops, partition_t partition,
 
       EXECUTE_IF_SET_IN_BITMAP (new_loops, 0, i, bi)
        if (bitmap_set_bit (loops, i))
-         collect_condition_stmts (get_loop (i), &conds);
+         collect_condition_stmts (get_loop (cfun, i), &conds);
 
       BITMAP_FREE (new_loops);
     }
index d5dde5fedb70dba0a239a411ae6124abbbc0b6e0..f68cd7f41246df8fdf4c996b6fcc397e59be4584 100644 (file)
@@ -422,7 +422,7 @@ chrec_contains_symbols_defined_in_loop (const_tree chrec, unsigned loop_nb)
 
       def = SSA_NAME_DEF_STMT (chrec);
       def_loop = loop_containing_stmt (def);
-      loop = get_loop (loop_nb);
+      loop = get_loop (cfun, loop_nb);
 
       if (def_loop == NULL)
        return false;
@@ -629,7 +629,7 @@ add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add,
                    gimple at_stmt)
 {
   tree type, left, right;
-  struct loop *loop = get_loop (loop_nb), *chloop;
+  struct loop *loop = get_loop (cfun, loop_nb), *chloop;
 
   switch (TREE_CODE (chrec_before))
     {
@@ -3258,7 +3258,7 @@ scev_const_prop (void)
   loop_iterator li;
   gimple_stmt_iterator psi;
 
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   FOR_EACH_BB (bb)
index 7e7f6f23833b566ce8e189d2378c6e5beca25066..55ba82c5dbd5a1b574b33c603a00ee936ee033b7 100644 (file)
@@ -64,7 +64,7 @@ instantiate_parameters (struct loop *loop, tree chrec)
 static inline struct loop *
 get_chrec_loop (const_tree chrec)
 {
-  return get_loop (CHREC_VARIABLE (chrec));
+  return get_loop (cfun, CHREC_VARIABLE (chrec));
 }
 
 #endif  /* GCC_TREE_SCALAR_EVOLUTION_H  */
index b8dd1a361a9b97f19181890c753cb8b84cd9397c..a1d02997eda1a03c3b15883aab6487a26dfb18fe 100644 (file)
@@ -136,7 +136,7 @@ copy_loop_headers (void)
 
   loop_optimizer_init (LOOPS_HAVE_PREHEADERS
                       | LOOPS_HAVE_SIMPLE_LATCHES);
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     {
       loop_optimizer_finalize ();
       return 0;
index 90e4d361e2f7d6fe298ff6660bbdd37a7d41f38e..e5e502b29013be402a042050c63fd7a81612fe5d 100644 (file)
@@ -1593,7 +1593,7 @@ analyze_memory_references (void)
   /* Initialize bb_loop_postorder with a mapping from loop->num to
      its postorder index.  */
   i = 0;
-  bb_loop_postorder = XNEWVEC (unsigned, number_of_loops ());
+  bb_loop_postorder = XNEWVEC (unsigned, number_of_loops (cfun));
   FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
     bb_loop_postorder[loop->num] = i++;
   /* Collect all basic-blocks in loops and sort them after their
@@ -2563,14 +2563,14 @@ tree_ssa_lim_initialize (void)
   memory_accesses.refs_list.quick_push
     (mem_ref_alloc (error_mark_node, 0, UNANALYZABLE_MEM_ID));
 
-  memory_accesses.refs_in_loop.create (number_of_loops ());
-  memory_accesses.refs_in_loop.quick_grow (number_of_loops ());
-  memory_accesses.refs_stored_in_loop.create (number_of_loops ());
-  memory_accesses.refs_stored_in_loop.quick_grow (number_of_loops ());
-  memory_accesses.all_refs_stored_in_loop.create (number_of_loops ());
-  memory_accesses.all_refs_stored_in_loop.quick_grow (number_of_loops ());
+  memory_accesses.refs_in_loop.create (number_of_loops (cfun));
+  memory_accesses.refs_in_loop.quick_grow (number_of_loops (cfun));
+  memory_accesses.refs_stored_in_loop.create (number_of_loops (cfun));
+  memory_accesses.refs_stored_in_loop.quick_grow (number_of_loops (cfun));
+  memory_accesses.all_refs_stored_in_loop.create (number_of_loops (cfun));
+  memory_accesses.all_refs_stored_in_loop.quick_grow (number_of_loops (cfun));
 
-  for (i = 0; i < number_of_loops (); i++)
+  for (i = 0; i < number_of_loops (cfun); i++)
     {
       bitmap_initialize (&memory_accesses.refs_in_loop[i],
                         &lim_bitmap_obstack);
index 7101f30d4e648844ea40dc2dba7baa2739ed76c4..edc5b7b5fdd9670f9cce9d0c54a58c66f06a73a0 100644 (file)
@@ -493,7 +493,7 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
   bitmap names_to_rename;
 
   loops_state_set (LOOP_CLOSED_SSA);
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return;
 
   /* If the pass has caused the SSA form to be out-of-date, update it
@@ -516,7 +516,7 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
     {
       /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
         that are the destination of an edge exiting loop number I.  */
-      bitmap *loop_exits = XNEWVEC (bitmap, number_of_loops ());
+      bitmap *loop_exits = XNEWVEC (bitmap, number_of_loops (cfun));
       get_loops_exits (loop_exits);
 
       /* Add the PHI nodes on exits of the loops for the names we need to
@@ -578,7 +578,7 @@ verify_loop_closed_ssa (bool verify_ssa_p)
   edge e;
   edge_iterator ei;
 
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return;
 
   if (verify_ssa_p)
index ae5b500d1caa955296420a62a4c9095890338f28..99e27a1359a6077249fd9166b1fad01c14645319 100644 (file)
@@ -74,7 +74,7 @@ tree_ssa_loop_init (void)
      regions into reducible.  */
   scev_initialize ();
 
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return 0;
@@ -105,7 +105,7 @@ struct gimple_opt_pass pass_tree_loop_init =
 static unsigned int
 tree_ssa_loop_im (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return tree_ssa_lim ();
@@ -142,7 +142,7 @@ struct gimple_opt_pass pass_lim =
 static unsigned int
 tree_ssa_loop_unswitch (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return tree_ssa_unswitch_loops ();
@@ -216,7 +216,7 @@ struct gimple_opt_pass pass_predcom =
 static unsigned int
 tree_vectorize (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return vectorize_loops ();
@@ -323,7 +323,7 @@ struct gimple_opt_pass pass_graphite_transforms =
 static unsigned int
 check_data_deps (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   tree_check_data_deps ();
@@ -361,7 +361,7 @@ struct gimple_opt_pass pass_check_data_deps =
 static unsigned int
 tree_ssa_loop_ivcanon (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return canonicalize_induction_variables ();
@@ -428,7 +428,7 @@ struct gimple_opt_pass pass_scev_cprop =
 static unsigned int
 tree_ssa_loop_bounds (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   estimate_numbers_of_iterations ();
@@ -461,7 +461,7 @@ struct gimple_opt_pass pass_record_bounds =
 static unsigned int
 tree_complete_unroll (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return tree_unroll_loops_completely (flag_unroll_loops
@@ -504,7 +504,7 @@ tree_complete_unroll_inner (void)
 
   loop_optimizer_init (LOOPS_NORMAL
                       | LOOPS_HAVE_RECORDED_EXITS);
-  if (number_of_loops () > 1)
+  if (number_of_loops (cfun) > 1)
     {
       scev_initialize ();
       ret = tree_unroll_loops_completely (optimize >= 3, false);
@@ -553,7 +553,7 @@ gate_tree_parallelize_loops (void)
 static unsigned
 tree_parallelize_loops (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   if (parallelize_loops ())
@@ -586,7 +586,7 @@ struct gimple_opt_pass pass_parallelize_loops =
 static unsigned int
 tree_ssa_loop_prefetch (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   return tree_ssa_prefetch_arrays ();
@@ -623,7 +623,7 @@ struct gimple_opt_pass pass_loop_prefetch =
 static unsigned int
 tree_ssa_loop_ivopts (void)
 {
-  if (number_of_loops () <= 1)
+  if (number_of_loops (cfun) <= 1)
     return 0;
 
   tree_ssa_iv_optimize ();
index 15a9176689282fb995d46f37a4a6dd7f28cac0be..215206743e8eaec6b13646c89ed1a3c9056c5c06 100644 (file)
@@ -2117,7 +2117,8 @@ execute_update_addresses_taken (void)
          }
 
       /* Update SSA form here, we are called as non-pass as well.  */
-      if (number_of_loops () > 1 && loops_state_satisfies_p (LOOP_CLOSED_SSA))
+      if (number_of_loops (cfun) > 1
+         && loops_state_satisfies_p (LOOP_CLOSED_SSA))
        rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
       else
        update_ssa (TODO_update_ssa);
index 0227d08c9f0928bc857952a7f5f34933959ccce1..843a03ca85cebea67fe04619d98a8cf51c9a4b72 100644 (file)
@@ -87,7 +87,7 @@ vectorize_loops (void)
   loop_iterator li;
   struct loop *loop;
 
-  vect_loops_num = number_of_loops ();
+  vect_loops_num = number_of_loops (cfun);
 
   /* Bail out if there are no loops.  */
   if (vect_loops_num <= 1)
@@ -139,7 +139,7 @@ vectorize_loops (void)
     {
       loop_vec_info loop_vinfo;
 
-      loop = get_loop (i);
+      loop = get_loop (cfun, i);
       if (!loop)
        continue;
       loop_vinfo = (loop_vec_info) loop->aux;
This page took 0.11971 seconds and 5 git commands to generate.