summaryrefslogtreecommitdiff
path: root/gcc/cfgloopanal.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-27 17:23:11 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-27 17:23:11 +0000
commit7a3bf727e16b2e01cb8d18c050a1fdfe1175da2f (patch)
tree877b6d8a4f3bb9732c119f5030e7349e852d40a1 /gcc/cfgloopanal.c
parentdfbbba6106fee07791f0313f926d1c3d46b3f7a0 (diff)
downloadgcc-7a3bf727e16b2e01cb8d18c050a1fdfe1175da2f.tar.gz
* tree-vrp.c (execute_vrp): Do not check whether current_loops == NULL.
* tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto. * ifcvt.c (if_convert): Ditto. * tree-ssa-threadupdate.c (thread_block): Ditto. (thread_through_all_blocks): Ditto. Assert that loops were analysed. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, verify_loop_closed_ssa): Check number_of_loops instead of current_loops. * predict.c (tree_estimate_probability): Ditto. * tree-if-conv.c (main_tree_if_conversion): Ditto. * tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * modulo-sched.c (sms_schedule): Ditto. * tree-scalar-evolution.c (scev_const_prop): Ditto. (scev_finalize): Do not do anything if scev analysis was not initialized. * cfgloopanal.c (mark_irreducible_loops): Do not check whether current_loops == NULL. (mark_loop_exit_edges): Check number_of_loops instead of current_loops. * loop-init.c (loop_optimizer_init): Do not free current_loops when there are no loops. (loop_optimizer_finalize): Assert that loops were analyzed. (rtl_move_loop_invariants, rtl_unswitch, rtl_unroll_and_peel_loops, rtl_doloop): Check number_of_loops instead of current_loops. * tree-ssa-loop.c (tree_loop_optimizer_init): Do not check whether current_loops == NULL. (tree_ssa_loop_init, tree_ssa_loop_im, tree_ssa_loop_unswitch, gate_tree_vectorize tree_linear_transform, check_data_deps, tree_ssa_loop_ivcanon, tree_ssa_empty_loop, tree_ssa_loop_bounds, tree_complete_unroll, tree_ssa_loop_prefetch, tree_ssa_loop_ivopts): Check number_of_loops instead of current_loops. (tree_ssa_loop_done): Do not check whether current_loops == NULL. * tree-ssa-pre.c (fini_pre): Do not take do_fre argument. Always free loops if available. (execute_pre): Do not pass do_fre to fini_pre. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopanal.c')
-rw-r--r--gcc/cfgloopanal.c70
1 files changed, 32 insertions, 38 deletions
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 54d00ce574c..760542a0ba8 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -273,7 +273,7 @@ mark_irreducible_loops (void)
edge_iterator ei;
int i, src, dest;
struct graph *g;
- int num = current_loops ? number_of_loops () : 1;
+ int num = number_of_loops ();
int *queue1 = XNEWVEC (int, last_basic_block + num);
int *queue2 = XNEWVEC (int, last_basic_block + num);
int nq;
@@ -281,6 +281,8 @@ mark_irreducible_loops (void)
struct loop *cloop, *loop;
loop_iterator li;
+ gcc_assert (current_loops != NULL);
+
/* Reset the flags. */
FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
{
@@ -302,36 +304,32 @@ mark_irreducible_loops (void)
src = BB_REPR (act);
dest = BB_REPR (e->dest);
- if (current_loops)
- {
- /* Ignore latch edges. */
- if (e->dest->loop_father->header == e->dest
- && e->dest->loop_father->latch == act)
- continue;
+ /* Ignore latch edges. */
+ if (e->dest->loop_father->header == e->dest
+ && e->dest->loop_father->latch == act)
+ continue;
+
+ /* Edges inside a single loop should be left where they are. Edges
+ to subloop headers should lead to representative of the subloop,
+ but from the same place.
- /* Edges inside a single loop should be left where they are. Edges
- to subloop headers should lead to representative of the subloop,
- but from the same place.
-
- Edges exiting loops should lead from representative
- of the son of nearest common ancestor of the loops in that
- act lays. */
-
- if (e->dest->loop_father->header == e->dest)
- dest = LOOP_REPR (e->dest->loop_father);
-
- if (!flow_bb_inside_loop_p (act->loop_father, e->dest))
- {
- depth = 1 + loop_depth (find_common_loop (act->loop_father,
- e->dest->loop_father));
- if (depth == loop_depth (act->loop_father))
- cloop = act->loop_father;
- else
- cloop = VEC_index (loop_p, act->loop_father->superloops,
- depth);
-
- src = LOOP_REPR (cloop);
- }
+ Edges exiting loops should lead from representative
+ of the son of nearest common ancestor of the loops in that
+ act lays. */
+
+ if (e->dest->loop_father->header == e->dest)
+ dest = LOOP_REPR (e->dest->loop_father);
+
+ if (!flow_bb_inside_loop_p (act->loop_father, e->dest))
+ {
+ depth = 1 + loop_depth (find_common_loop (act->loop_father,
+ e->dest->loop_father));
+ if (depth == loop_depth (act->loop_father))
+ cloop = act->loop_father;
+ else
+ cloop = VEC_index (loop_p, act->loop_father->superloops, depth);
+
+ src = LOOP_REPR (cloop);
}
add_edge (g, src, dest, e);
@@ -347,12 +345,9 @@ mark_irreducible_loops (void)
queue1[nq++] = BB_REPR (act);
}
- if (current_loops)
+ FOR_EACH_LOOP (li, loop, 0)
{
- FOR_EACH_LOOP (li, loop, 0)
- {
- queue1[nq++] = LOOP_REPR (loop);
- }
+ queue1[nq++] = LOOP_REPR (loop);
}
dfs (g, queue1, nq, queue2, false);
for (i = 0; i < nq; i++)
@@ -366,8 +361,7 @@ mark_irreducible_loops (void)
free (queue1);
free (queue2);
- if (current_loops)
- current_loops->state |= LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS;
+ current_loops->state |= LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS;
}
/* Counts number of insns inside LOOP. */
@@ -605,7 +599,7 @@ mark_loop_exit_edges (void)
basic_block bb;
edge e;
- if (!current_loops)
+ if (number_of_loops () <= 1)
return;
FOR_EACH_BB (bb)