annotate gcc/predict.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Definitions for branch prediction routines in the GNU compiler.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #ifndef GCC_PREDICT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #define GCC_PREDICT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
111
kono
parents: 67
diff changeset
23 #include "profile-count.h"
kono
parents: 67
diff changeset
24
kono
parents: 67
diff changeset
25 /* Random guesstimation given names.
kono
parents: 67
diff changeset
26 PROB_VERY_UNLIKELY should be small enough so basic block predicted
kono
parents: 67
diff changeset
27 by it gets below HOT_BB_FREQUENCY_FRACTION. */
kono
parents: 67
diff changeset
28 #define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1)
kono
parents: 67
diff changeset
29 #define PROB_EVEN (REG_BR_PROB_BASE / 2)
kono
parents: 67
diff changeset
30 #define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY)
kono
parents: 67
diff changeset
31 #define PROB_ALWAYS (REG_BR_PROB_BASE)
kono
parents: 67
diff changeset
32 #define PROB_UNLIKELY (REG_BR_PROB_BASE / 5 - 1)
kono
parents: 67
diff changeset
33 #define PROB_LIKELY (REG_BR_PROB_BASE - PROB_UNLIKELY)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
34 #define PROB_UNINITIALIZED (-1)
111
kono
parents: 67
diff changeset
35
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 #define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) ENUM,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 enum br_predictor
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 #include "predict.def"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 /* Upper bound on non-language-specific builtins. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 END_PREDICTORS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 #undef DEF_PREDICTOR
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 enum prediction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 NOT_TAKEN,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 TAKEN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
111
kono
parents: 67
diff changeset
51 /* In emit-rtl.c. */
kono
parents: 67
diff changeset
52 extern profile_probability split_branch_probability;
kono
parents: 67
diff changeset
53
kono
parents: 67
diff changeset
54 extern gcov_type get_hot_bb_threshold (void);
kono
parents: 67
diff changeset
55 extern void set_hot_bb_threshold (gcov_type);
kono
parents: 67
diff changeset
56 extern bool maybe_hot_count_p (struct function *, profile_count);
kono
parents: 67
diff changeset
57 extern bool maybe_hot_bb_p (struct function *, const_basic_block);
kono
parents: 67
diff changeset
58 extern bool maybe_hot_edge_p (edge);
kono
parents: 67
diff changeset
59 extern bool probably_never_executed_bb_p (struct function *, const_basic_block);
kono
parents: 67
diff changeset
60 extern bool probably_never_executed_edge_p (struct function *, edge);
kono
parents: 67
diff changeset
61 extern bool optimize_function_for_size_p (struct function *);
kono
parents: 67
diff changeset
62 extern bool optimize_function_for_speed_p (struct function *);
kono
parents: 67
diff changeset
63 extern optimization_type function_optimization_type (struct function *);
kono
parents: 67
diff changeset
64 extern bool optimize_bb_for_size_p (const_basic_block);
kono
parents: 67
diff changeset
65 extern bool optimize_bb_for_speed_p (const_basic_block);
kono
parents: 67
diff changeset
66 extern optimization_type bb_optimization_type (const_basic_block);
kono
parents: 67
diff changeset
67 extern bool optimize_edge_for_size_p (edge);
kono
parents: 67
diff changeset
68 extern bool optimize_edge_for_speed_p (edge);
kono
parents: 67
diff changeset
69 extern bool optimize_insn_for_size_p (void);
kono
parents: 67
diff changeset
70 extern bool optimize_insn_for_speed_p (void);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
71 extern bool optimize_loop_for_size_p (class loop *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
72 extern bool optimize_loop_for_speed_p (class loop *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
73 extern bool optimize_loop_nest_for_speed_p (class loop *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
74 extern bool optimize_loop_nest_for_size_p (class loop *);
111
kono
parents: 67
diff changeset
75 extern bool predictable_edge_p (edge);
kono
parents: 67
diff changeset
76 extern void rtl_profile_for_bb (basic_block);
kono
parents: 67
diff changeset
77 extern void rtl_profile_for_edge (edge);
kono
parents: 67
diff changeset
78 extern void default_rtl_profile (void);
kono
parents: 67
diff changeset
79 extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor);
kono
parents: 67
diff changeset
80 extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor);
kono
parents: 67
diff changeset
81 extern bool edge_probability_reliable_p (const_edge);
kono
parents: 67
diff changeset
82 extern bool br_prob_note_reliable_p (const_rtx);
kono
parents: 67
diff changeset
83 extern void predict_insn_def (rtx_insn *, enum br_predictor, enum prediction);
kono
parents: 67
diff changeset
84 extern void rtl_predict_edge (edge, enum br_predictor, int);
kono
parents: 67
diff changeset
85 extern void gimple_predict_edge (edge, enum br_predictor, int);
kono
parents: 67
diff changeset
86 extern void remove_predictions_associated_with_edge (edge);
kono
parents: 67
diff changeset
87 extern void predict_edge_def (edge, enum br_predictor, enum prediction);
kono
parents: 67
diff changeset
88 extern void invert_br_probabilities (rtx);
kono
parents: 67
diff changeset
89 extern void guess_outgoing_edge_probabilities (basic_block);
kono
parents: 67
diff changeset
90 extern void tree_guess_outgoing_edge_probabilities (basic_block);
kono
parents: 67
diff changeset
91 extern void tree_estimate_probability (bool);
kono
parents: 67
diff changeset
92 extern void handle_missing_profiles (void);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
93 extern bool update_max_bb_count (void);
111
kono
parents: 67
diff changeset
94 extern bool expensive_function_p (int);
kono
parents: 67
diff changeset
95 extern void estimate_bb_frequencies (bool);
kono
parents: 67
diff changeset
96 extern void compute_function_frequency (void);
kono
parents: 67
diff changeset
97 extern tree build_predict_expr (enum br_predictor, enum prediction);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 extern const char *predictor_name (enum br_predictor);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
99 extern void rebuild_frequencies (void);
111
kono
parents: 67
diff changeset
100 extern void report_predictor_hitrates (void);
kono
parents: 67
diff changeset
101 extern void force_edge_cold (edge, bool);
kono
parents: 67
diff changeset
102 extern void propagate_unlikely_bbs_forward (void);
kono
parents: 67
diff changeset
103
kono
parents: 67
diff changeset
104 extern void add_reg_br_prob_note (rtx_insn *, profile_probability);
kono
parents: 67
diff changeset
105
kono
parents: 67
diff changeset
106 /* In ipa-pure-const.c */
kono
parents: 67
diff changeset
107 extern void warn_function_cold (tree);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 #endif /* GCC_PREDICT_H */