summaryrefslogtreecommitdiff
path: root/gcc/loop-init.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-27 08:56:03 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-27 08:56:03 +0000
commitd4f078b55bd4a139c5c12ff24ccba03a01cf6568 (patch)
treebd4ad7e7b2c8112a0f115b874c66bb4632a2280b /gcc/loop-init.c
parent2c4c872529d6e1051fb9cdd641ad5cc9fbc0e2cb (diff)
downloadgcc-d4f078b55bd4a139c5c12ff24ccba03a01cf6568.tar.gz
2015-10-27 Richard Biener <rguenther@suse.de>
* cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229405 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r--gcc/loop-init.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index a9a3d6fa98a..2a38a0f7566 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -111,7 +111,7 @@ loop_optimizer_init (unsigned flags)
/* Clear all flags. */
if (recorded_exits)
- release_recorded_exits ();
+ release_recorded_exits (cfun);
loops_state_clear (~0U);
if (needs_fixup)
@@ -139,43 +139,41 @@ loop_optimizer_init (unsigned flags)
/* Finalize loop structures. */
void
-loop_optimizer_finalize (void)
+loop_optimizer_finalize (struct function *fn)
{
struct loop *loop;
basic_block bb;
timevar_push (TV_LOOP_FINI);
- if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
- release_recorded_exits ();
+ if (loops_state_satisfies_p (fn, LOOPS_HAVE_RECORDED_EXITS))
+ release_recorded_exits (fn);
- free_numbers_of_iterations_estimates ();
+ free_numbers_of_iterations_estimates (fn);
/* If we should preserve loop structure, do not free it but clear
flags that advanced properties are there as we are not preserving
that in full. */
- if (cfun->curr_properties & PROP_loops)
+ if (fn->curr_properties & PROP_loops)
{
- loops_state_clear (LOOP_CLOSED_SSA
+ loops_state_clear (fn, LOOP_CLOSED_SSA
| LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS
| LOOPS_HAVE_PREHEADERS
| LOOPS_HAVE_SIMPLE_LATCHES
| LOOPS_HAVE_FALLTHRU_PREHEADERS);
- loops_state_set (LOOPS_MAY_HAVE_MULTIPLE_LATCHES);
+ loops_state_set (fn, LOOPS_MAY_HAVE_MULTIPLE_LATCHES);
goto loop_fini_done;
}
- gcc_assert (current_loops != NULL);
-
- FOR_EACH_LOOP (loop, 0)
+ FOR_EACH_LOOP_FN (fn, loop, 0)
free_simple_loop_desc (loop);
/* Clean up. */
- flow_loops_free (current_loops);
- ggc_free (current_loops);
- current_loops = NULL;
+ flow_loops_free (loops_for_fn (fn));
+ ggc_free (loops_for_fn (fn));
+ set_loops_for_fn (fn, NULL);
- FOR_ALL_BB_FN (bb, cfun)
+ FOR_ALL_BB_FN (bb, fn)
{
bb->loop_father = NULL;
}
@@ -215,7 +213,7 @@ fix_loop_structure (bitmap changed_bbs)
if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
{
- release_recorded_exits ();
+ release_recorded_exits (cfun);
record_exits = LOOPS_HAVE_RECORDED_EXITS;
}