summaryrefslogtreecommitdiff
path: root/gcc/predict.def
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-28 21:37:35 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-28 21:37:35 +0000
commiteb42964415d14caa18dcc2eca05f04af547fd58f (patch)
tree9dcbd6f10eb7084accad68aa621c0f3eb6a081d1 /gcc/predict.def
parent0dbe40e076463c44e7d824f2eb3a2c63c9e32ab8 (diff)
downloadgcc-eb42964415d14caa18dcc2eca05f04af547fd58f.tar.gz
* basic-block.h (EDGE_FREQUENCY): New macro.
* bb-reorder (fixup_reorder_chain): Set counts and frequencies for new BB/edges. * flow.c (find_sub_basic_blocks): Likewise. (try_crossjump_to_edge): Likewise; use EDGE_FREQUENCY (redirect_edge_and_branch): Use EDGE_FREQUENCY. * predict.c (DEF_PREDICTOR): New argument FLAGS. (HITRATE): New macro. (PRED_FLAG_FIRST_MATCH): New constant. (predictor_info): New field flgags. (combine_predictions_for_insn): Use DS theory to combine probabilities; set the edge probabilities when finished. (estimate_probability): Avoid duplicated matches of LOOP_BRANCH heuristics for nested loops; update comment. * predict.def: Add flags for each prediction, set probabilities according to B&L paper. * predict.h (DEF_PREDICTOR): New argument FLAGS. * profile.c (compute_branch_probabilities): Cleanup way the edge probabilities are computed and REG_BR_PROB notes are dropped; if values does not match, emit error. (init_branch_prob): Do error instead of warning when profile driven feedback is missing or corrupt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44439 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.def')
-rw-r--r--gcc/predict.def37
1 files changed, 22 insertions, 15 deletions
diff --git a/gcc/predict.def b/gcc/predict.def
index ff8171bcc68..577f035e97e 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -36,47 +36,54 @@ Boston, MA 02111-1307, USA. */
REG_BR_PROB_BASE / 2). */
+/* An combined heuristics using Dempster-Shaffer theory. */
+DEF_PREDICTOR (PRED_COMBINED, "combined", PROB_ALWAYS, 0)
+
/* An combined heuristics using probability determined by first
matching heuristics from this list. */
-DEF_PREDICTOR (PRED_FIRST_MATCH, "first match", PROB_ALWAYS)
+DEF_PREDICTOR (PRED_FIRST_MATCH, "first match", PROB_ALWAYS, 0)
/* Mark unconditional jump as taken. */
-DEF_PREDICTOR (PRED_UNCONDITIONAL, "unconditional jump", PROB_ALWAYS)
+DEF_PREDICTOR (PRED_UNCONDITIONAL, "unconditional jump", PROB_ALWAYS,
+ PRED_FLAG_FIRST_MATCH)
/* Use number of loop iterations determined by loop unroller to set
- probability. */
-DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS)
+ probability. We don't want to use Dempster-Shaffer theory here,
+ as the predictions is exact. */
+DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS,
+ PRED_FLAG_FIRST_MATCH)
/* Hints dropped by user via __builtin_expect feature. */
-DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY)
+DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY,
+ PRED_FLAG_FIRST_MATCH)
/* Branch to basic block containing call marked by noreturn attribute. */
-DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_ALWAYS)
+DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_ALWAYS, 0)
/* Loopback edge is taken. */
-DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", PROB_VERY_LIKELY)
+DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (88), 0)
/* Edge causing loop to terminate is probably not taken. */
-DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", PROB_LIKELY)
+DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (80), 0)
/* Condition emitted by preconditiong code to ensure that variable
setting number of iterations is greater than initial value of iterator. */
-DEF_PREDICTOR (PRED_LOOP_CONDITION, "loop condition", PROB_VERY_LIKELY)
+DEF_PREDICTOR (PRED_LOOP_CONDITION, "loop condition", PROB_VERY_LIKELY, 0)
/* Preconditioning makes linear list of branches. */
-DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY)
+DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY, 0)
/* Copied condition for the first iteration of loop is probably true. */
-DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", PROB_LIKELY)
+DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", HITRATE (75), 0)
/* Pointers are usually not NULL. */
-DEF_PREDICTOR (PRED_POINTER, "pointer", PROB_LIKELY)
+DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (60), 0)
/* NE is probable, EQ not etc... */
-DEF_PREDICTOR (PRED_OPCODE, "opcode", PROB_LIKELY)
+DEF_PREDICTOR (PRED_OPCODE, "opcode", HITRATE (84), 0)
/* Branch guarding call is probably taken. */
-DEF_PREDICTOR (PRED_CALL, "call", PROB_LIKELY)
+DEF_PREDICTOR (PRED_CALL, "call", HITRATE (78), 0)
/* Branch causing function to terminate is probably not taken. */
-DEF_PREDICTOR (PRED_ERROR_RETURN, "error return", PROB_LIKELY)
+DEF_PREDICTOR (PRED_ERROR_RETURN, "error return", PROB_LIKELY, 0)