aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-11-22 00:54:16 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-11-21 23:54:16 +0000
commitac8f6c69032b9a07b3036a2514bd59353b2a32c3 (patch)
treebf6b0974fc31405c052970da079d8c6c75d72a63 /gcc/cfgloop.c
parentbf8dbe38637ce885c1b7af763f7728955083195e (diff)
downloadgcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.zip
gcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.tar.gz
gcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.tar.bz2
tree-loop-linear.c (linear_transform_loops): Use single_exit accessor functions.
* tree-loop-linear.c (linear_transform_loops): Use single_exit accessor functions. * tree-ssa-loop-niter.c (loop_only_exit_p): Ditto. * cfgloopmanip.c (update_single_exits_after_duplication, update_single_exit_for_duplicated_loop, loop_version): Ditto. * tree-scalar-evolution.c (get_loop_exit_condition, get_exit_conditions_rec, loop_closed_phi_def, number_of_iterations_in_loop, scev_const_prop): Ditto. * tree-ssa-loop-ivopts.c (single_dom_exit): Ditto. * modulo-sched.c (generate_prolog_epilog, loop_canon_p, sms_schedule): Ditto. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Ditto. * tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, slpeel_tree_peel_loop_to_edge): Ditto. * tree-if-conv.c (if_convertible_loop_p): Ditto. * tree-vect-analyze.c (vect_analyze_operations, vect_stmt_relevant_p, vect_analyze_loop_form): Ditto. * lambda-code.c (lambda_loopnest_to_gcc_loopnest, exit_phi_for_loop_p, can_convert_to_perfect_nest, perfect_nestify): Ditto. * tree-vect-transform.c (vect_create_epilog_for_reduction, vect_update_ivs_after_vectorizer, vect_do_peeling_for_loop_bound, vect_transform_loop): Ditto. * cfgloop.c (mark_single_exit_loops, verify_loop_structure): Ditto. (single_exit, set_single_exit): New functions. * cfgloop.h (struct loop): Rename single_exit field to single_exit_. (single_exit, set_single_exit): Declare. * doc/loop.texi: Undocument single_exit field. Document single_exit accessor function. From-SVN: r119075
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index e00e6a6..b168b97 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -251,7 +251,7 @@ mark_single_exit_loops (struct loops *loops)
{
loop = loops->parray[i];
if (loop)
- loop->single_exit = NULL;
+ set_single_exit (loop, NULL);
}
FOR_EACH_BB (bb)
@@ -273,10 +273,10 @@ mark_single_exit_loops (struct loops *loops)
{
/* If we have already seen an exit, mark this by the edge that
surely does not occur as any exit. */
- if (loop->single_exit)
- loop->single_exit = single_succ_edge (ENTRY_BLOCK_PTR);
+ if (single_exit (loop))
+ set_single_exit (loop, single_succ_edge (ENTRY_BLOCK_PTR));
else
- loop->single_exit = e;
+ set_single_exit (loop, e);
}
}
}
@@ -287,8 +287,8 @@ mark_single_exit_loops (struct loops *loops)
if (!loop)
continue;
- if (loop->single_exit == single_succ_edge (ENTRY_BLOCK_PTR))
- loop->single_exit = NULL;
+ if (single_exit (loop) == single_succ_edge (ENTRY_BLOCK_PTR))
+ set_single_exit (loop, NULL);
}
loops->state |= LOOPS_HAVE_MARKED_SINGLE_EXITS;
@@ -1142,12 +1142,12 @@ verify_loop_structure (struct loops *loops)
loop = loop->outer)
{
sizes[loop->num]++;
- if (loop->single_exit
- && loop->single_exit != e)
+ if (single_exit (loop)
+ && single_exit (loop) != e)
{
error ("wrong single exit %d->%d recorded for loop %d",
- loop->single_exit->src->index,
- loop->single_exit->dest->index,
+ single_exit (loop)->src->index,
+ single_exit (loop)->dest->index,
loop->num);
error ("right exit is %d->%d",
e->src->index, e->dest->index);
@@ -1164,19 +1164,19 @@ verify_loop_structure (struct loops *loops)
continue;
if (sizes[i] == 1
- && !loop->single_exit)
+ && !single_exit (loop))
{
error ("single exit not recorded for loop %d", loop->num);
err = 1;
}
if (sizes[i] != 1
- && loop->single_exit)
+ && single_exit (loop))
{
error ("loop %d should not have single exit (%d -> %d)",
loop->num,
- loop->single_exit->src->index,
- loop->single_exit->dest->index);
+ single_exit (loop)->src->index,
+ single_exit (loop)->dest->index);
err = 1;
}
}
@@ -1216,3 +1216,20 @@ loop_exit_edge_p (const struct loop *loop, edge e)
return (flow_bb_inside_loop_p (loop, e->src)
&& !flow_bb_inside_loop_p (loop, e->dest));
}
+
+/* Returns the single exit edge of LOOP, or NULL if LOOP has either no exit
+ or more than one exit. */
+
+edge
+single_exit (const struct loop *loop)
+{
+ return loop->single_exit_;
+}
+
+/* Records E as a single exit edge of LOOP. */
+
+void
+set_single_exit (struct loop *loop, edge e)
+{
+ loop->single_exit_ = e;
+}