summaryrefslogtreecommitdiff
path: root/gcc/cfgloopmanip.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-11 09:05:12 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-11 09:05:12 +0000
commitea091dfdfe023dacb0c7c2af37bdd75e23c530f4 (patch)
treec92921efb68fbb5a7e8dd2d9a10b526b2c5a61bf /gcc/cfgloopmanip.c
parent57825007304f2b6f71742e5096cba24edfeeb6d6 (diff)
downloadgcc-ea091dfdfe023dacb0c7c2af37bdd75e23c530f4.tar.gz
* basic-block.h (single_succ_p, single_pred_p, single_succ_edge,
single_pred_edge, single_succ, single_pred): New inline functions. * bb-reorder.c (rotate_loop, find_traces_1_round, add_labels_and_missing_jumps, fix_up_fall_thru_edges, duplicate_computed_gotos): Use the single_succ/pred functions. * cfganal.c (forwarder_block_p): Ditto. * cfgbuild.c (compute_outgoing_frequencies): Ditto. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, merge_seq_blocks): Ditto. * cfghooks.c (split_edge, tidy_fallthru_edges): Ditto. * cfglayout.c (fixup_reorder_chain): Ditto. * cfgloop.c (mark_single_exit_loops, update_latch_info, canonicalize_loop_headers, verify_loop_structure): Ditto. * cfgloopmanip.c (remove_path, unloop, loop_delete_branch_edge, mfb_update_loops, create_preheader, force_single_succ_latches, create_loop_notes): Ditto. * cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, commit_one_edge_insertion, purge_dead_edges, cfg_layout_can_merge_blocks_p): Ditto. * except.c (sjlj_emit_function_enter): Ditto. * flow.c (init_propagate_block_info): Ditto. * function.c (thread_prologue_and_epilogue_insns): Ditto. * gcse.c (find_implicit_sets, bypass_conditional_jumps, insert_insn_end_bb): Ditto. * ifcvt.c (merge_if_block, find_if_block, find_if_case_1, find_if_case_2): Ditto. * lambda-code.c (perfect_nestify): Ditto. * lcm.c (optimize_mode_switching): Ditto. * loop-doloop.c (doloop_modify): Ditto. * loop-init.c (loop_optimizer_init): Ditto. * loop-iv.c (simplify_using_initial_values): Ditto. * loop-unroll.c (unroll_loop_runtime_iterations): Ditto. * loop-unswitch.c (unswitch_loop): Ditto. * modulo-sched.c (generate_prolog_epilog): Ditto. * predict.c (combine_predictions_for_insn, estimate_probability, tree_estimate_probability, last_basic_block_p, estimate_bb_frequencies): Ditto. * profile.c (branch_prob): Ditto. * regrename.c (copyprop_hardreg_forward): Ditto. * sched-rgn.c (is_cfg_nonregular, find_rgns, update_live): Ditto. * tracer.c (layout_superblocks): Ditto. * tree-cfg.c (tree_can_merge_blocks_p, tree_merge_blocks, cfg_remove_useless_stmts_bb, cleanup_control_flow, cleanup_control_expr_graph, disband_implicit_edges, tree_find_edge_insert_loc, bsi_commit_edge_inserts, tree_verify_flow_info, tree_make_forwarder_block, tree_forwarder_block_p, remove_forwarder_block, remove_forwarder_block_with_phi, merge_phi_nodes): Ditto. * tree-if-conv.c (tree_if_conversion): Ditto. * tree-mudflap.c (mf_build_check_statement_for): Ditto. * tree-ssa-dce.c (remove_dead_stmt): Ditto. * tree-ssa-dom.c (dom_opt_finalize_block): Ditto. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p, copy_loop_headers): Ditto. * tree-ssa-loop-im.c (loop_commit_inserts): Ditto. * tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Ditto. * tree-ssa-loop-manip.c (split_loop_exit_edge, ip_normal_pos, lv_adjust_loop_entry_edge, tree_ssa_loop_version): Ditto. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Ditto. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Ditto. * tree-ssa-phiopt.c (tree_ssa_phiopt, value_replacement): Ditto. * tree-ssa-pre.c (compute_antic_aux, insert_aux, init_pre): Ditto. * tree-ssa-threadupdate.c (redirect_edges): Ditto. * tree-tailcall.c (independent_of_stmt_p, find_tail_calls, eliminate_tail_call, tree_optimize_tail_calls_1): Ditto. * tree-vect-analyze.c (vect_analyze_loop_form): Ditto. * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto. * tree-vectorizer.c (slpeel_update_phi_nodes_for_guard, slpeel_add_loop_guard): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96292 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r--gcc/cfgloopmanip.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 7405380fb25..bd55788483d 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -331,8 +331,8 @@ remove_path (struct loops *loops, edge e)
e, but we only have basic block dominators. This is easy to
fix -- when e->dest has exactly one predecessor, this corresponds
to blocks dominated by e->dest, if not, split the edge. */
- if (EDGE_COUNT (e->dest->preds) > 1)
- e = EDGE_PRED (loop_split_edge_with (e, NULL_RTX), 0);
+ if (!single_pred_p (e->dest))
+ e = single_pred_edge (loop_split_edge_with (e, NULL_RTX));
/* It may happen that by removing path we remove one or more loops
we belong to. In this case first unloop the loops, then proceed
@@ -623,7 +623,7 @@ unloop (struct loops *loops, struct loop *loop)
loops->parray[loop->num] = NULL;
flow_loop_free (loop);
- remove_edge (EDGE_SUCC (latch, 0));
+ remove_edge (single_succ_edge (latch));
fix_bb_placements (loops, latch);
/* If the loop was inside an irreducible region, we would have to somehow
@@ -802,8 +802,8 @@ loop_delete_branch_edge (edge e, int really_delete)
if (!redirect_edge_and_branch (e, newdest))
return false;
- EDGE_SUCC (src, 0)->flags &= ~EDGE_IRREDUCIBLE_LOOP;
- EDGE_SUCC (src, 0)->flags |= irr;
+ single_succ_edge (src)->flags &= ~EDGE_IRREDUCIBLE_LOOP;
+ single_succ_edge (src)->flags |= irr;
return true;
}
@@ -1121,10 +1121,10 @@ mfb_keep_just (edge e)
static void
mfb_update_loops (basic_block jump)
{
- struct loop *loop = EDGE_SUCC (jump, 0)->dest->loop_father;
+ struct loop *loop = single_succ (jump)->loop_father;
if (dom_computed[CDI_DOMINATORS])
- set_immediate_dominator (CDI_DOMINATORS, jump, EDGE_PRED (jump, 0)->src);
+ set_immediate_dominator (CDI_DOMINATORS, jump, single_pred (jump));
add_bb_to_loop (jump, loop);
loop->latch = jump;
}
@@ -1154,7 +1154,7 @@ create_preheader (struct loop *loop, int flags)
continue;
irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
nentry++;
- if (EDGE_COUNT (e->src->succs) == 1)
+ if (single_succ_p (e->src))
one_succ_pred = e;
}
gcc_assert (nentry);
@@ -1165,7 +1165,7 @@ create_preheader (struct loop *loop, int flags)
e = EDGE_PRED (loop->header,
EDGE_PRED (loop->header, 0)->src == loop->latch);
- if (!(flags & CP_SIMPLE_PREHEADERS) || EDGE_COUNT (e->src->succs) == 1)
+ if (!(flags & CP_SIMPLE_PREHEADERS) || single_succ_p (e->src))
return NULL;
}
@@ -1206,7 +1206,7 @@ create_preheader (struct loop *loop, int flags)
if (irred)
{
dummy->flags |= BB_IRREDUCIBLE_LOOP;
- EDGE_SUCC (dummy, 0)->flags |= EDGE_IRREDUCIBLE_LOOP;
+ single_succ_edge (dummy)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
if (dump_file)
@@ -1239,7 +1239,7 @@ force_single_succ_latches (struct loops *loops)
for (i = 1; i < loops->num; i++)
{
loop = loops->parray[i];
- if (loop->latch != loop->header && EDGE_COUNT (loop->latch->succs) == 1)
+ if (loop->latch != loop->header && single_succ_p (loop->latch))
continue;
e = find_edge (loop->latch, loop->header);
@@ -1341,9 +1341,9 @@ create_loop_notes (void)
&& onlyjump_p (insn))
{
pbb = BLOCK_FOR_INSN (insn);
- gcc_assert (pbb && EDGE_COUNT (pbb->succs) == 1);
+ gcc_assert (pbb && single_succ_p (pbb));
- if (!flow_bb_inside_loop_p (loop, EDGE_SUCC (pbb, 0)->dest))
+ if (!flow_bb_inside_loop_p (loop, single_succ (pbb)))
insn = BB_HEAD (first[loop->num]);
}
else