OSDN Git Service

* g++.old-deja/g++.pt/static11.C: Add xtensa-*-elf* to the
[pf3gnuchains/gcc-fork.git] / gcc / predict.def
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
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
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
39 /* A value used as final outcome of all heuristics.  */
40 DEF_PREDICTOR (PRED_COMBINED, "combined", PROB_ALWAYS, 0)
41
42 /* An outcome estimated by Dempster-Shaffer theory.  */
43 DEF_PREDICTOR (PRED_DS_THEORY, "DS theory", PROB_ALWAYS, 0)
44
45 /* An combined heuristics using probability determined by first
46    matching heuristics from this list.  */
47 DEF_PREDICTOR (PRED_FIRST_MATCH, "first match", PROB_ALWAYS, 0)
48
49 /* Heuristic applying when no heuristic below applies.  */
50 DEF_PREDICTOR (PRED_NO_PREDICTION, "no prediction", PROB_ALWAYS, 0)
51
52 /* Mark unconditional jump as taken.  */
53 DEF_PREDICTOR (PRED_UNCONDITIONAL, "unconditional jump", PROB_ALWAYS,
54                PRED_FLAG_FIRST_MATCH)
55
56 /* Use number of loop iterations determined by loop unroller to set
57    probability.  We don't want to use Dempster-Shaffer theory here,
58    as the predictions is exact.  */
59 DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS,
60                PRED_FLAG_FIRST_MATCH)
61
62 /* Hints dropped by user via __builtin_expect feature.  */
63 DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY,
64                PRED_FLAG_FIRST_MATCH)
65
66 /* Branch containing goto is probably not taken.  */
67 DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (56), 0)
68
69 /* Branch to basic block containing call marked by noreturn attribute.  */
70 DEF_PREDICTOR (PRED_NORETURN, "noreturn call", HITRATE (99),
71                PRED_FLAG_FIRST_MATCH)
72
73 /* Loopback edge is taken.  */
74 DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (89),
75                PRED_FLAG_FIRST_MATCH)
76
77 /* Edge causing loop to terminate is probably not taken. */
78 DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (90),
79                PRED_FLAG_FIRST_MATCH)
80
81 /* Condition emitted by preconditiong code to ensure that variable
82    setting number of iterations is greater than initial value of iterator.  */
83 DEF_PREDICTOR (PRED_LOOP_CONDITION, "loop condition", PROB_VERY_LIKELY, 0)
84
85 /* Preconditioning makes linear list of branches.  */
86 DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY, 0)
87
88 /* Copied condition for the first iteration of loop is probably true.  */
89 DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", HITRATE (64), 0)
90
91 /* Pointers are usually not NULL.  */
92 DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (81), 0)
93
94 /* NE is probable, EQ not etc...  */
95 DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (79), 0)
96 DEF_PREDICTOR (PRED_OPCODE_NONEQUAL, "opcode values nonequal", HITRATE (71), 0)
97 DEF_PREDICTOR (PRED_FPOPCODE, "fp_opcode", HITRATE (90), 0)
98
99 /* Branch guarding call is probably taken.  */
100 DEF_PREDICTOR (PRED_CALL, "call", HITRATE (70), 0)
101
102 /* Branch causing function to terminate is probably not taken.  */
103 DEF_PREDICTOR (PRED_EARLY_RETURN, "early return", HITRATE (67), 0)
104
105 /* Branch containing goto is probably not taken.  */
106 DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (70), 0)
107
108 /* Branch ending with return constant is probably not taken.  */
109 DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (95), 0)
110
111 /* Branch ending with return negative constant is probably not taken.  */
112 DEF_PREDICTOR (PRED_NEGATIVE_RETURN, "negative return", HITRATE (96), 0)
113
114 /* Branch ending with return; is probably not taken */
115 DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (90), 0)