aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2007-05-27 17:23:11 +0000
committerZdenek Dvorak <dvorakz@suse.cz>2007-05-27 17:23:11 +0000
commit026db79617d3012e4d44d4ab65c5e84261bc833b (patch)
tree877b6d8a4f3bb9732c119f5030e7349e852d40a1 /gcc/tree-ssa-threadupdate.c
parent68b65cb7e27efab20ffb0dc695bb7a3ccec00ea1 (diff)
* 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: https://gcc.gnu.org/svn/gcc/trunk@125114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 6732f2e2899..815c84fb7b3 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -530,7 +530,7 @@ thread_block (basic_block bb, bool noloop_only)
/* If we thread the latch of the loop to its exit, the loop ceases to
exist. Make sure we do not restrict ourselves in order to preserve
this loop. */
- if (current_loops && loop->header == bb)
+ if (loop->header == bb)
{
e = loop_latch_edge (loop);
e2 = e->aux;
@@ -552,7 +552,6 @@ thread_block (basic_block bb, bool noloop_only)
/* If NOLOOP_ONLY is true, we only allow threading through the
header of a loop to exit edges. */
|| (noloop_only
- && current_loops
&& bb == bb->loop_father->header
&& !loop_exit_edge_p (bb->loop_father, e2)))
{
@@ -1023,6 +1022,9 @@ thread_through_all_blocks (bool may_peel_loop_headers)
struct loop *loop;
loop_iterator li;
+ /* We must know about loops in order to preserve them. */
+ gcc_assert (current_loops != NULL);
+
if (threaded_edges == NULL)
return false;
@@ -1046,16 +1048,13 @@ thread_through_all_blocks (bool may_peel_loop_headers)
/* Then perform the threading through loop headers. We start with the
innermost loop, so that the changes in cfg we perform won't affect
further threading. */
- if (current_loops)
+ FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
{
- FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
- {
- if (!loop->header
- || !bitmap_bit_p (threaded_blocks, loop->header->index))
- continue;
+ if (!loop->header
+ || !bitmap_bit_p (threaded_blocks, loop->header->index))
+ continue;
- retval |= thread_through_loop_header (loop, may_peel_loop_headers);
- }
+ retval |= thread_through_loop_header (loop, may_peel_loop_headers);
}
if (retval)