aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-03-11 10:05:12 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-03-11 09:05:12 +0000
commitc5cbcccf9019f6ed28209f903245cce9cfc73e40 (patch)
treec92921efb68fbb5a7e8dd2d9a10b526b2c5a61bf /gcc/tree-tailcall.c
parent0b2df4a7037bf50942bb43ae799f88a7d6c4c261 (diff)
downloadgcc-c5cbcccf9019f6ed28209f903245cce9cfc73e40.zip
gcc-c5cbcccf9019f6ed28209f903245cce9cfc73e40.tar.gz
gcc-c5cbcccf9019f6ed28209f903245cce9cfc73e40.tar.bz2
basic-block.h (single_succ_p, [...]): New inline functions.
* 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. From-SVN: r96292
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index cca99a4..8f4778d 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -211,7 +211,7 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
/* Mark the blocks in the chain leading to the end. */
at_bb = bb_for_stmt (at);
call_bb = bb_for_stmt (bsi_stmt (bsi));
- for (bb = call_bb; bb != at_bb; bb = EDGE_SUCC (bb, 0)->dest)
+ for (bb = call_bb; bb != at_bb; bb = single_succ (bb))
bb->aux = &bb->aux;
bb->aux = &bb->aux;
@@ -255,7 +255,7 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
}
/* Unmark the blocks. */
- for (bb = call_bb; bb != at_bb; bb = EDGE_SUCC (bb, 0)->dest)
+ for (bb = call_bb; bb != at_bb; bb = single_succ (bb))
bb->aux = NULL;
bb->aux = NULL;
@@ -382,7 +382,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
basic_block abb;
stmt_ann_t ann;
- if (EDGE_COUNT (bb->succs) > 1)
+ if (!single_succ_p (bb))
return;
for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
@@ -482,8 +482,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
while (bsi_end_p (absi))
{
- ass_var = propagate_through_phis (ass_var, EDGE_SUCC (abb, 0));
- abb = EDGE_SUCC (abb, 0)->dest;
+ ass_var = propagate_through_phis (ass_var, single_succ_edge (abb));
+ abb = single_succ (abb);
absi = bsi_start (abb);
}
@@ -701,7 +701,7 @@ eliminate_tail_call (struct tailcall *t)
if (TREE_CODE (stmt) == MODIFY_EXPR)
stmt = TREE_OPERAND (stmt, 1);
- first = EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest;
+ first = single_succ (ENTRY_BLOCK_PTR);
/* Remove the code after call_bsi that will become unreachable. The
possibly unreachable code in other blocks is removed later in
@@ -721,7 +721,7 @@ eliminate_tail_call (struct tailcall *t)
}
/* Replace the call by a jump to the start of function. */
- e = redirect_edge_and_branch (EDGE_SUCC (t->call_block, 0), first);
+ e = redirect_edge_and_branch (single_succ_edge (t->call_block), first);
gcc_assert (e);
PENDING_STMT (e) = NULL_TREE;
@@ -776,7 +776,7 @@ eliminate_tail_call (struct tailcall *t)
var_ann (param)->default_def = new_name;
phi = create_phi_node (name, first);
SSA_NAME_DEF_STMT (name) = phi;
- add_phi_arg (phi, new_name, EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
+ add_phi_arg (phi, new_name, single_succ_edge (ENTRY_BLOCK_PTR));
/* For all calls the same set of variables should be clobbered. This
means that there always should be the appropriate phi node except
@@ -843,7 +843,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
bool phis_constructed = false;
struct tailcall *tailcalls = NULL, *act, *next;
bool changed = false;
- basic_block first = EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest;
+ basic_block first = single_succ (ENTRY_BLOCK_PTR);
tree stmt, param, ret_type, tmp, phi;
edge_iterator ei;
@@ -873,8 +873,8 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
if (!phis_constructed)
{
/* Ensure that there is only one predecessor of the block. */
- if (EDGE_COUNT (first->preds) > 1)
- first = split_edge (EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
+ if (!single_pred_p (first))
+ first = split_edge (single_succ_edge (ENTRY_BLOCK_PTR));
/* Copy the args if needed. */
for (param = DECL_ARGUMENTS (current_function_decl);
@@ -894,7 +894,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
var_ann (param)->default_def = new_name;
phi = create_phi_node (name, first);
SSA_NAME_DEF_STMT (name) = phi;
- add_phi_arg (phi, new_name, EDGE_PRED (first, 0));
+ add_phi_arg (phi, new_name, single_pred_edge (first));
}
phis_constructed = true;
}
@@ -911,7 +911,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
/* RET_TYPE can be a float when -ffast-maths is
enabled. */
fold_convert (ret_type, integer_zero_node),
- EDGE_PRED (first, 0));
+ single_pred_edge (first));
a_acc = PHI_RESULT (phi);
}
@@ -927,7 +927,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
/* RET_TYPE can be a float when -ffast-maths is
enabled. */
fold_convert (ret_type, integer_one_node),
- EDGE_PRED (first, 0));
+ single_pred_edge (first));
m_acc = PHI_RESULT (phi);
}
}