diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-30 08:14:09 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-30 08:14:09 +0000 |
commit | 41f75a999228fc54b0b6cb5d84a2bdb2d413f207 (patch) | |
tree | 356ddee9dfac457bc8a4d0e0c56e83d56f1f6a48 /gcc/cfgloop.h | |
parent | 2090f4f01dec1647e39695611d3b4f4b64bb5620 (diff) | |
download | gcc-41f75a999228fc54b0b6cb5d84a2bdb2d413f207.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.h')
-rw-r--r-- | gcc/cfgloop.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 5c38599cc6c..0f247996630 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -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) |