summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-23 19:23:51 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-23 19:23:51 +0000
commit4c26117afc55fbf0b998d0bf25f1ab56da4dd180 (patch)
treed9ef360c452a150ca3f25a23e593846ce26b64f0 /gcc/local-alloc.c
parentdf64d85ee58f6385c06511417a9a8a2f60a17261 (diff)
downloadgcc-4c26117afc55fbf0b998d0bf25f1ab56da4dd180.tar.gz
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index d4aa8bbdb65..dea22dd869e 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -336,8 +336,9 @@ alloc_qty (regno, mode, size, birth)
int
local_alloc ()
{
- int b, i;
+ int i;
int max_qty;
+ basic_block b;
/* We need to keep track of whether or not we recorded a LABEL_REF so
that we know if the jump optimizer needs to be rerun. */
@@ -394,7 +395,7 @@ local_alloc ()
/* Allocate each block's local registers, block by block. */
- for (b = 0; b < n_basic_blocks; b++)
+ FOR_EACH_BB (b)
{
/* NEXT_QTY indicates which elements of the `qty_...'
vectors might need to be initialized because they were used
@@ -426,7 +427,7 @@ local_alloc ()
next_qty = 0;
- block_alloc (b);
+ block_alloc (b->index);
}
free (qty);
@@ -815,7 +816,7 @@ static void
update_equiv_regs ()
{
rtx insn;
- int block;
+ basic_block bb;
int loop_depth;
regset_head cleared_regs;
int clear_regnos = 0;
@@ -828,9 +829,8 @@ update_equiv_regs ()
/* Scan the insns and find which registers have equivalences. Do this
in a separate scan of the insns because (due to -fcse-follow-jumps)
a register can be set below its use. */
- for (block = 0; block < n_basic_blocks; block++)
+ FOR_EACH_BB (bb)
{
- basic_block bb = BASIC_BLOCK (block);
loop_depth = bb->loop_depth;
for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn))
@@ -1044,10 +1044,8 @@ update_equiv_regs ()
within the same loop (or in an inner loop), then move the register
initialization just before the use, so that they are in the same
basic block. */
- for (block = n_basic_blocks - 1; block >= 0; block--)
+ FOR_EACH_BB_REVERSE (bb)
{
- basic_block bb = BASIC_BLOCK (block);
-
loop_depth = bb->loop_depth;
for (insn = bb->end; insn != PREV_INSN (bb->head); insn = PREV_INSN (insn))
{
@@ -1139,12 +1137,12 @@ update_equiv_regs ()
XEXP (reg_equiv[regno].init_insns, 0) = new_insn;
- REG_BASIC_BLOCK (regno) = block >= 0 ? block : 0;
+ REG_BASIC_BLOCK (regno) = bb->index;
REG_N_CALLS_CROSSED (regno) = 0;
REG_LIVE_LENGTH (regno) = 2;
- if (block >= 0 && insn == BLOCK_HEAD (block))
- BLOCK_HEAD (block) = PREV_INSN (insn);
+ if (insn == bb->head)
+ bb->head = PREV_INSN (insn);
/* Remember to clear REGNO from all basic block's live
info. */
@@ -1159,24 +1157,22 @@ update_equiv_regs ()
/* Clear all dead REGNOs from all basic block's live info. */
if (clear_regnos)
{
- int j, l;
+ int j;
if (clear_regnos > 8)
{
- for (l = 0; l < n_basic_blocks; l++)
+ FOR_EACH_BB (bb)
{
- AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_start,
- &cleared_regs);
- AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_end,
- &cleared_regs);
+ AND_COMPL_REG_SET (bb->global_live_at_start, &cleared_regs);
+ AND_COMPL_REG_SET (bb->global_live_at_end, &cleared_regs);
}
}
else
EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j,
{
- for (l = 0; l < n_basic_blocks; l++)
+ FOR_EACH_BB (bb)
{
- CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_start, j);
- CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_end, j);
+ CLEAR_REGNO_REG_SET (bb->global_live_at_start, j);
+ CLEAR_REGNO_REG_SET (bb->global_live_at_end, j);
}
});
}