aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-03-01 14:44:46 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-03-01 13:44:46 +0000
commit70388d9433b275054b72014b54f387933f1d8d02 (patch)
tree5b1c8a12d24075ced5f333d3ddacf873da6903a0 /gcc/tree-if-conv.c
parentb279b20ab3eacc439ecb98f26374f428d43eee77 (diff)
downloadgcc-70388d9433b275054b72014b54f387933f1d8d02.zip
gcc-70388d9433b275054b72014b54f387933f1d8d02.tar.gz
gcc-70388d9433b275054b72014b54f387933f1d8d02.tar.bz2
cfgloop.c (flow_loop_entry_edges_find, [...]): Removed.
* cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find, flow_loop_pre_header_scan, flow_loop_pre_header_find, flow_loop_scan): Removed. (flow_loop_dump): Do not dump removed fields. (flow_loop_free): Do not free removed fields. (flow_loops_find): Flags argument removed. Do not call flow_loop_scan. (loop_exit_edge_p): New function. * cfgloop.h (struct loop): Removed fields pre_header, pre_header_edges, num_pre_header_edges, entry_edges, num_entries, exit_edges, num_exits, exits_doms. (LOOP_TREE, LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES, LOOP_EDGES, LOOP_ALL): Removed. (flow_loop_scan): Declaration removed. (loop_exit_edge_p, mark_loop_exit_edges): Declare. * cfgloopmanip.c (create_loop_notes): Do not pass flags to flow_loops_find. * ifcvt.c (mark_loop_exit_edges): Moved to cfgloopanal.c. (if_convert): Call flow_loops_find and flow_loops_free when calling mark_loop_exit_edges. * cfgloopanal.c (mark_loop_exit_edges): Moved from ifcvt.c. Removed the flow_loops_find, flow_loops_free and free_dominance_info calls. * loop-init.c (flow_loops_find): Ditto. * passes.c (rest_of_handle_branch_prob): Ditto. * lambda-code.c (perfect_nestify): Do not call flow_loops_find. * loop-unroll.c (analyze_insns_in_loop): Do not use EDGE_LOOP_EXIT. * predict.c (predict_loops): Do not call flow_loop_scan. Use get_loop_exit_edges. (tree_estimate_probability): Do not pass flags to flow_loops_find. * tree-if-conv.c (bb_with_exit_edge_p): Take loop as argument. Do not use EDGE_LOOP_EXIT. (tree_if_convert_cond_expr, if_convertible_modify_expr_p): Pass loop to bb_with_exit_edge_p. (if_convertible_loop_p): Do not call flow_loop_scan. Use loop->single_exit. Do not use EDGE_LOOP_EXIT. Pass loop to bb_with_exit_edge_p. (combine_blocks): Pass loop to bb_with_exit_edge_p. Do not use EDGE_LOOP_EXIT. * tree-loop-linear.c (linear_transform_loops): Do not call flow_loop_scan. Use loop->single_exit. * tree-vect-analyze.c (vect_analyze_operations): Use loop->single_exit. (vect_analyze_loop_form): Do not call flow_loop_scan. * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Use loop->single_exit. (vect_do_peeling_for_loop_bound): Use loop_preheader_edge and loop->single_exit. * tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop, slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_verify_cfg_after_peeling, slpeel_tree_peel_loop_to_edge): Use loop_preheader_edge and loop->single_exit. Do not call flow_loop_scan. From-SVN: r95738
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 52bcfba..bb832d2 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -126,7 +126,7 @@ static void combine_blocks (struct loop *);
static tree ifc_temp_var (tree, tree);
static bool pred_blocks_visited_p (basic_block, bitmap *);
static basic_block * get_loop_body_in_if_conv_order (const struct loop *loop);
-static bool bb_with_exit_edge_p (basic_block);
+static bool bb_with_exit_edge_p (struct loop *, basic_block);
/* List of basic blocks in if-conversion-suitable order. */
static basic_block *ifc_bbs;
@@ -312,7 +312,7 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
/* Now this conditional statement is redundant. Remove it.
But, do not remove exit condition! Update exit condition
using new condition. */
- if (!bb_with_exit_edge_p (bb_for_stmt (stmt)))
+ if (!bb_with_exit_edge_p (loop, bb_for_stmt (stmt)))
{
bsi_remove (bsi);
cond = NULL_TREE;
@@ -405,7 +405,7 @@ if_convertible_modify_expr_p (struct loop *loop, basic_block bb, tree m_expr)
if (TREE_CODE (TREE_OPERAND (m_expr, 0)) != SSA_NAME
&& bb != loop->header
- && !bb_with_exit_edge_p (bb))
+ && !bb_with_exit_edge_p (loop, bb))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -534,8 +534,6 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
return false;
}
- flow_loop_scan (loop, LOOP_ALL);
-
/* If only one block, no need for if-conversion. */
if (loop->num_nodes <= 2)
{
@@ -545,7 +543,7 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
}
/* More than one loop exit is too much to handle. */
- if (loop->num_exits > 1)
+ if (!loop->single_exit)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "multiple exits\n");
@@ -557,8 +555,10 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
/* If one of the loop header's edge is exit edge then do not apply
if-conversion. */
FOR_EACH_EDGE (e, ei, loop->header->succs)
- if ( e->flags & EDGE_LOOP_EXIT)
- return false;
+ {
+ if (loop_exit_edge_p (loop, e))
+ return false;
+ }
compute_immediate_uses (TDFA_USE_OPS|TDFA_USE_VOPS, NULL);
@@ -593,7 +593,7 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
if (!if_convertible_phi_p (loop, bb, phi))
return false;
- if (bb_with_exit_edge_p (bb))
+ if (bb_with_exit_edge_p (loop, bb))
exit_bb_seen = true;
}
@@ -874,7 +874,7 @@ combine_blocks (struct loop *loop)
bb = ifc_bbs[i];
- if (!exit_bb && bb_with_exit_edge_p (bb))
+ if (!exit_bb && bb_with_exit_edge_p (loop, bb))
exit_bb = bb;
if (bb == exit_bb)
@@ -890,11 +890,13 @@ combine_blocks (struct loop *loop)
{
/* Redirect non-exit edge to loop->latch. */
FOR_EACH_EDGE (e, ei, bb->succs)
- if (!(e->flags & EDGE_LOOP_EXIT))
- {
- redirect_edge_and_branch (e, loop->latch);
- set_immediate_dominator (CDI_DOMINATORS, loop->latch, bb);
- }
+ {
+ if (!loop_exit_edge_p (loop, e))
+ {
+ redirect_edge_and_branch (e, loop->latch);
+ set_immediate_dominator (CDI_DOMINATORS, loop->latch, bb);
+ }
+ }
}
continue;
}
@@ -1056,17 +1058,17 @@ get_loop_body_in_if_conv_order (const struct loop *loop)
return blocks;
}
-/* Return true if one of the basic block BB edge is loop exit. */
+/* Return true if one of the basic block BB edge is exit of LOOP. */
static bool
-bb_with_exit_edge_p (basic_block bb)
+bb_with_exit_edge_p (struct loop *loop, basic_block bb)
{
edge e;
edge_iterator ei;
bool exit_edge_found = false;
FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->flags & EDGE_LOOP_EXIT)
+ if (loop_exit_edge_p (loop, e))
{
exit_edge_found = true;
break;