]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/predict.def
Makefile.in, [...]: replace "GNU CC" with "GCC".
[thirdparty/gcc.git] / gcc / predict.def
CommitLineData
4db384c9
JH
1/* This file contains the definitions and documentation for the
2 builtins used in the GNU compiler.
3 Copyright (C) 2001 Free Software Foundation, Inc.
4
1322177d 5This file is part of GCC.
4db384c9 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
4db384c9 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
4db384c9
JH
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
4db384c9
JH
21
22/* Before including this file, you should define a macro:
23
24 DEF_PREDICTOR (ENUM, NAME, HITRATE)
25
26 This macro will be called once for each predictor. The ENUM will
27 be of type `enum predictor', and will enumerate all supported
28 predictors. The order of DEF_PREDICTOR calls is important, as
29 in the first match combining heuristics, the predictor appearing
30 first in this file will win.
31
32 NAME is used in the debugging output to determine predictor type.
33
34 HITRATE is the probability that edge predicted by predictor as taken
35 will be really taken (so it should be always above
36 REG_BR_PROB_BASE / 2). */
37
38
d195b46f 39/* A value used as final outcome of all heuristics. */
134d3a2e
JH
40DEF_PREDICTOR (PRED_COMBINED, "combined", PROB_ALWAYS, 0)
41
d195b46f
JH
42/* An outcome estimated by Dempster-Shaffer theory. */
43DEF_PREDICTOR (PRED_DS_THEORY, "DS theory", PROB_ALWAYS, 0)
44
923cbdc3
JH
45/* An combined heuristics using probability determined by first
46 matching heuristics from this list. */
134d3a2e 47DEF_PREDICTOR (PRED_FIRST_MATCH, "first match", PROB_ALWAYS, 0)
923cbdc3 48
d195b46f
JH
49/* Heuristic applying when no heuristic bellow applies. */
50DEF_PREDICTOR (PRED_NO_PREDICTION, "no prediction", PROB_ALWAYS, 0)
51
923cbdc3 52/* Mark unconditional jump as taken. */
134d3a2e
JH
53DEF_PREDICTOR (PRED_UNCONDITIONAL, "unconditional jump", PROB_ALWAYS,
54 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
55
56/* Use number of loop iterations determined by loop unroller to set
134d3a2e
JH
57 probability. We don't want to use Dempster-Shaffer theory here,
58 as the predictions is exact. */
59DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS,
60 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
61
62/* Hints dropped by user via __builtin_expect feature. */
134d3a2e
JH
63DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY,
64 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
65
66/* Branch to basic block containing call marked by noreturn attribute. */
8b7e92f9
JH
67DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_ALWAYS,
68 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
69
70/* Loopback edge is taken. */
6ad48e84 71DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (89),
8b7e92f9 72 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
73
74/* Edge causing loop to terminate is probably not taken. */
6ad48e84 75DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (90),
8b7e92f9 76 PRED_FLAG_FIRST_MATCH)
923cbdc3
JH
77
78/* Condition emitted by preconditiong code to ensure that variable
79 setting number of iterations is greater than initial value of iterator. */
134d3a2e 80DEF_PREDICTOR (PRED_LOOP_CONDITION, "loop condition", PROB_VERY_LIKELY, 0)
923cbdc3
JH
81
82/* Preconditioning makes linear list of branches. */
134d3a2e 83DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY, 0)
923cbdc3
JH
84
85/* Copied condition for the first iteration of loop is probably true. */
6ad48e84 86DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", HITRATE (64), 0)
923cbdc3
JH
87
88/* Pointers are usually not NULL. */
6ad48e84 89DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (83), 0)
923cbdc3
JH
90
91/* NE is probable, EQ not etc... */
6ad48e84 92DEF_PREDICTOR (PRED_OPCODE, "opcode", HITRATE (55), 0)
923cbdc3
JH
93
94/* Branch guarding call is probably taken. */
6ad48e84 95DEF_PREDICTOR (PRED_CALL, "call", HITRATE (70), 0)
923cbdc3
JH
96
97/* Branch causing function to terminate is probably not taken. */
134d3a2e 98DEF_PREDICTOR (PRED_ERROR_RETURN, "error return", PROB_LIKELY, 0)