summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-12 22:58:22 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-12 22:58:22 +0000
commit5018c250118696d37986d14aa91cc388791c4a43 (patch)
treed2df1cff7b7b6d39cad373f658025e733516f5d3
parent354363fb354ac0da1e9a6edd0541ab378242090d (diff)
downloadgcc-5018c250118696d37986d14aa91cc388791c4a43.tar.gz
* predict.c (estimate_probability): Remove.
* profile.c (rest_of_handle_branch_prob, pass_branch_prob): Remove. * basic-block.h (estimate_probability): Remove prototype. * passes.c (finish_optimization_passes): Dump branch prediction or profiling heuristics to the .profile tree dump. (init_optimization_passes): Unqueue pass_branch_prob. * doc/invoke.texi (-fdump-rtl-bp): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111980 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/basic-block.h1
-rw-r--r--gcc/doc/invoke.texi6
-rw-r--r--gcc/passes.c5
-rw-r--r--gcc/predict.c79
-rw-r--r--gcc/profile.c43
6 files changed, 13 insertions, 132 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ffcdec083c4..ad4af116721 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2006-03-12 Steven Bosscher <stevenb.gcc@gmail.com>
+
+ * predict.c (estimate_probability): Remove.
+ * profile.c (rest_of_handle_branch_prob, pass_branch_prob): Remove.
+ * basic-block.h (estimate_probability): Remove prototype.
+ * passes.c (finish_optimization_passes): Dump branch prediction or
+ profiling heuristics to the .profile tree dump.
+ (init_optimization_passes): Unqueue pass_branch_prob.
+
+ * doc/invoke.texi (-fdump-rtl-bp): Remove.
+
2006-03-11 Steven Bosscher <stevenb.gcc@gmail.com>
* rtl.def (LABEL_REF): Remove the field for LABEL_NEXTREF.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index a07a517d39e..14c22e35466 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -869,7 +869,6 @@ extern struct edge_list *pre_edge_rev_lcm (int, sbitmap *,
extern void compute_available (sbitmap *, sbitmap *, sbitmap *, sbitmap *);
/* In predict.c */
-extern void estimate_probability (struct loops *);
extern void expected_value_to_br_prob (void);
extern bool maybe_hot_bb_p (basic_block);
extern bool probably_cold_bb_p (basic_block);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d1c2efdb98f..99fbf8f0707 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -3712,12 +3712,6 @@ letters for use in @var{letters} and @var{pass}, and their meanings:
@opindex dA
Annotate the assembler output with miscellaneous debugging information.
-@item -db
-@itemx -fdump-rtl-bp
-@opindex db
-@opindex fdump-rtl-bp
-Dump after computing branch probabilities, to @file{@var{file}.09.bp}.
-
@item -dB
@itemx -fdump-rtl-bbro
@opindex dB
diff --git a/gcc/passes.c b/gcc/passes.c
index 9732b2518e9..f6a97f65edf 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -216,10 +216,10 @@ finish_optimization_passes (void)
timevar_push (TV_DUMP);
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{
- dump_file = dump_begin (pass_branch_prob.static_pass_number, NULL);
+ dump_file = dump_begin (pass_profile.static_pass_number, NULL);
end_branch_prob ();
if (dump_file)
- dump_end (pass_branch_prob.static_pass_number, dump_file);
+ dump_end (pass_profile.static_pass_number, dump_file);
}
if (optimize > 0)
@@ -635,7 +635,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_gcse);
NEXT_PASS (pass_jump_bypass);
NEXT_PASS (pass_cfg);
- NEXT_PASS (pass_branch_prob);
NEXT_PASS (pass_rtl_ifcvt);
NEXT_PASS (pass_tracer);
/* Perform loop optimizations. It might be better to do them a bit
diff --git a/gcc/predict.c b/gcc/predict.c
index c59e57b0c5e..dd0cdc15470 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -826,85 +826,6 @@ bb_estimate_probability_locally (basic_block bb)
}
}
-/* Statically estimate the probability that a branch will be taken and produce
- estimated profile. When profile feedback is present never executed portions
- of function gets estimated. */
-
-void
-estimate_probability (struct loops *loops_info)
-{
- basic_block bb;
-
- connect_infinite_loops_to_exit ();
- calculate_dominance_info (CDI_DOMINATORS);
- calculate_dominance_info (CDI_POST_DOMINATORS);
-
- predict_loops (loops_info, true);
-
- iv_analysis_done ();
-
- /* Attempt to predict conditional jumps using a number of heuristics. */
- FOR_EACH_BB (bb)
- {
- rtx last_insn = BB_END (bb);
- edge e;
- edge_iterator ei;
-
- if (! can_predict_insn_p (last_insn))
- continue;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- {
- /* Predict early returns to be probable, as we've already taken
- care for error returns and other are often used for fast paths
- trought function. */
- if ((e->dest == EXIT_BLOCK_PTR
- || (single_succ_p (e->dest)
- && single_succ (e->dest) == EXIT_BLOCK_PTR))
- && !predicted_by_p (bb, PRED_NULL_RETURN)
- && !predicted_by_p (bb, PRED_CONST_RETURN)
- && !predicted_by_p (bb, PRED_NEGATIVE_RETURN)
- && !last_basic_block_p (e->dest))
- predict_edge_def (e, PRED_EARLY_RETURN, TAKEN);
-
- /* Look for block we are guarding (i.e. we dominate it,
- but it doesn't postdominate us). */
- if (e->dest != EXIT_BLOCK_PTR && e->dest != bb
- && dominated_by_p (CDI_DOMINATORS, e->dest, e->src)
- && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest))
- {
- rtx insn;
-
- /* The call heuristic claims that a guarded function call
- is improbable. This is because such calls are often used
- to signal exceptional situations such as printing error
- messages. */
- for (insn = BB_HEAD (e->dest); insn != NEXT_INSN (BB_END (e->dest));
- insn = NEXT_INSN (insn))
- if (CALL_P (insn)
- /* Constant and pure calls are hardly used to signalize
- something exceptional. */
- && ! CONST_OR_PURE_CALL_P (insn))
- {
- predict_edge_def (e, PRED_CALL, NOT_TAKEN);
- break;
- }
- }
- }
- bb_estimate_probability_locally (bb);
- }
-
- /* Attach the combined probability to each conditional jump. */
- FOR_EACH_BB (bb)
- combine_predictions_for_insn (BB_END (bb), bb);
-
- remove_fake_edges ();
- estimate_bb_frequencies (loops_info);
- free_dominance_info (CDI_POST_DOMINATORS);
- if (profile_status == PROFILE_ABSENT)
- profile_status = PROFILE_GUESSED;
-}
-
/* Set edge->probability for each successor edge of BB. */
void
guess_outgoing_edge_probabilities (basic_block bb)
diff --git a/gcc/profile.c b/gcc/profile.c
index 7fa9aad03ef..2f6d8aa5708 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1336,46 +1336,3 @@ tree_register_profile_hooks (void)
profile_hooks = &tree_profile_hooks;
}
-
-/* Do branch profiling and static profile estimation passes. */
-static unsigned int
-rest_of_handle_branch_prob (void)
-{
- struct loops loops;
-
- /* Discover and record the loop depth at the head of each basic
- block. The loop infrastructure does the real job for us. */
- flow_loops_find (&loops);
-
- if (dump_file)
- flow_loops_dump (&loops, dump_file, NULL, 0);
-
- /* Estimate using heuristics if no profiling info is available. */
- if (flag_guess_branch_prob
- && profile_status == PROFILE_ABSENT)
- estimate_probability (&loops);
-
- flow_loops_free (&loops);
- free_dominance_info (CDI_DOMINATORS);
- return 0;
-}
-
-struct tree_opt_pass pass_branch_prob =
-{
- "bp", /* name */
- NULL, /* gate */
- rest_of_handle_branch_prob, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_BRANCH_PROB, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func, /* todo_flags_finish */
- 'b' /* letter */
-};
-
-
-