summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-17 13:40:27 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-17 13:40:27 +0000
commit4d2e5d528864f897011ae82014889955d1558c97 (patch)
tree9df368d8d09a4cf8e6f2a79bb6e4864ceb6a4907 /gcc/predict.c
parentf7553d0a989fa4467612016b437d8734c65a4c50 (diff)
downloadgcc-4d2e5d528864f897011ae82014889955d1558c97.tar.gz
2005-12-17 Danny Berlin <dberlin@dberlin.org>
Kenneth Zadeck <zadeck@naturalbridge.com> * basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1. Changed insn iterators so that they are tolerant of blocks with no insns. * regrename.c (copyprop_hardreg_forward): Changed basic block numbering so that the entry block is 0 and the exit block is 1. * sched-ebb.c (sehedule_ebbs): Ditto. * tracer.c (branch_ratio_cutoff): Ditto. * cfgloopmanip.c (fix_loop_structure): Ditto. * cfghooks.c (verify_flow_info): Ditto. * cfg.c (compact_blocks): Ditto. * reorg.c (dbr_schedule): Ditto. * flow.c (calculate_global_regs_live, libcall_dead_p): Ditto. * dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree, calculate_dominance_info): Ditto. * cfganal.c (create_edge_list, print_edge_list, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute, dfs_enumerate_from): Ditto. * global.c (global_alloc, set_up_bb_rts_numbers): Ditto. * ifcvt.c (find_if_case_2): Ditto. * cfgbuild.c (control_flow_insn_p, count_basic_blocks, find_basic_blocks): Ditto. * predict.c (predict_loops, tree_bb_level_predictions, predict_paths_leading_to, propagate_freq): Ditto. * lcm.c (compute_antinout_edge, compute_laterin, compute_available): Ditto. * function.c (thread_prologue_and_epilogue_insns): Ditto. * gcse.c (gcse_main, bypass_jumps): Ditto. * profile.c (compute_branch_probabilities, compute_value_histograms, branch_prob): Ditto. * tree-flow-inline.h (bsi_start, bsi_after_labels, bsi_last): Ditto. * tree-ssa-phiopt.c (tree_ssa_phiopt, blocks_in_phiopt_order): Ditto. * bt-load.c (compute_defs_uses_and_gen, compute_kill, compute_out, link_btr_uses, migrate_btr_defs): Ditto. * tree-dfa.c (collect_dfa_stats): Ditto. * cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto. * cfglayout.c (fixup_reorder_chain): Ditto. * bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos, partition_hot_cold_basic_blocks): Ditto. * var-tracking.c (vt_find_locations): Ditto. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto. * sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto. * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto. * tree-ssa-reassoc.c (init_reassoc): Ditto. * cfgrtl.c (entry_of_function, rtl_verify_flow_info, rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto. * df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto and removed unused reverse orders. * df.h (): Ditto. * combine.c: Fix document typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108713 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 5cd3cb61bd3..2081efad81d 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -707,7 +707,7 @@ predict_loops (struct loops *loops_info, bool rtlsimpleloops)
conditional has no loop header successors as not taken. */
if (!header_found)
FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->dest->index < 0
+ if (e->dest->index < NUM_FIXED_BLOCKS
|| !flow_bb_inside_loop_p (loop, e->dest))
predict_edge
(e, PRED_LOOP_EXIT,
@@ -1271,7 +1271,7 @@ tree_bb_level_predictions (void)
int *heads;
heads = xmalloc (sizeof (int) * last_basic_block);
- memset (heads, -1, sizeof (int) * last_basic_block);
+ memset (heads, ENTRY_BLOCK, sizeof (int) * last_basic_block);
heads[ENTRY_BLOCK_PTR->next_bb->index] = last_basic_block;
apply_return_prediction (heads);
@@ -1500,7 +1500,7 @@ predict_paths_leading_to (basic_block bb, int *heads, enum br_predictor pred,
edge_iterator ei;
int y;
- if (heads[bb->index] < 0)
+ if (heads[bb->index] == ENTRY_BLOCK)
{
/* This is first time we need this field in heads array; so
find first dominator that we do not post-dominate (we are
@@ -1509,7 +1509,7 @@ predict_paths_leading_to (basic_block bb, int *heads, enum br_predictor pred,
basic_block next_ai = get_immediate_dominator (CDI_DOMINATORS, bb);
int head;
- while (heads[next_ai->index] < 0)
+ while (heads[next_ai->index] == ENTRY_BLOCK)
{
if (!dominated_by_p (CDI_POST_DOMINATORS, next_ai, bb))
break;
@@ -1524,10 +1524,7 @@ predict_paths_leading_to (basic_block bb, int *heads, enum br_predictor pred,
while (next_ai != bb)
{
next_ai = ai;
- if (heads[ai->index] == ENTRY_BLOCK)
- ai = ENTRY_BLOCK_PTR;
- else
- ai = BASIC_BLOCK (heads[ai->index]);
+ ai = BASIC_BLOCK (heads[ai->index]);
heads[next_ai->index] = head;
}
}
@@ -1538,7 +1535,7 @@ predict_paths_leading_to (basic_block bb, int *heads, enum br_predictor pred,
if (y == last_basic_block)
return;
FOR_EACH_EDGE (e, ei, BASIC_BLOCK (y)->succs)
- if (e->dest->index >= 0
+ if (e->dest->index >= NUM_FIXED_BLOCKS
&& dominated_by_p (CDI_POST_DOMINATORS, e->dest, bb))
predict_edge_def (e, pred, taken);
}
@@ -1596,12 +1593,7 @@ propagate_freq (struct loop *loop, bitmap tovisit)
/* The outermost "loop" includes the exit block, which we can not
look up via BASIC_BLOCK. Detect this and use EXIT_BLOCK_PTR
directly. Do the same for the entry block. */
- if (i == (unsigned)ENTRY_BLOCK)
- bb = ENTRY_BLOCK_PTR;
- else if (i == (unsigned)EXIT_BLOCK)
- bb = EXIT_BLOCK_PTR;
- else
- bb = BASIC_BLOCK (i);
+ bb = BASIC_BLOCK (i);
FOR_EACH_EDGE (e, ei, bb->preds)
{