annotate gcc/predict.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
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.
16
kono
parents: 14
diff changeset
2 Copyright (C) 2001-2017 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
16
kono
parents: 14
diff changeset
23 #include "profile-count.h"
kono
parents: 14
diff changeset
24
kono
parents: 14
diff changeset
25 /* Random guesstimation given names.
kono
parents: 14
diff changeset
26 PROB_VERY_UNLIKELY should be small enough so basic block predicted
kono
parents: 14
diff changeset
27 by it gets below HOT_BB_FREQUENCY_FRACTION. */
kono
parents: 14
diff changeset
28 #define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1)
kono
parents: 14
diff changeset
29 #define PROB_EVEN (REG_BR_PROB_BASE / 2)
kono
parents: 14
diff changeset
30 #define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY)
kono
parents: 14
diff changeset
31 #define PROB_ALWAYS (REG_BR_PROB_BASE)
kono
parents: 14
diff changeset
32 #define PROB_UNLIKELY (REG_BR_PROB_BASE / 5 - 1)
kono
parents: 14
diff changeset
33 #define PROB_LIKELY (REG_BR_PROB_BASE - PROB_UNLIKELY)
kono
parents: 14
diff changeset
34
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 #define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) ENUM,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 enum br_predictor
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 #include "predict.def"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 /* Upper bound on non-language-specific builtins. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 END_PREDICTORS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 #undef DEF_PREDICTOR
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 enum prediction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 NOT_TAKEN,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 TAKEN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
16
kono
parents: 14
diff changeset
50 /* In emit-rtl.c. */
kono
parents: 14
diff changeset
51 extern profile_probability split_branch_probability;
kono
parents: 14
diff changeset
52
kono
parents: 14
diff changeset
53 extern gcov_type get_hot_bb_threshold (void);
kono
parents: 14
diff changeset
54 extern void set_hot_bb_threshold (gcov_type);
kono
parents: 14
diff changeset
55 extern bool maybe_hot_count_p (struct function *, profile_count);
kono
parents: 14
diff changeset
56 extern bool maybe_hot_bb_p (struct function *, const_basic_block);
kono
parents: 14
diff changeset
57 extern bool maybe_hot_edge_p (edge);
kono
parents: 14
diff changeset
58 extern bool probably_never_executed_bb_p (struct function *, const_basic_block);
kono
parents: 14
diff changeset
59 extern bool probably_never_executed_edge_p (struct function *, edge);
kono
parents: 14
diff changeset
60 extern bool optimize_function_for_size_p (struct function *);
kono
parents: 14
diff changeset
61 extern bool optimize_function_for_speed_p (struct function *);
kono
parents: 14
diff changeset
62 extern optimization_type function_optimization_type (struct function *);
kono
parents: 14
diff changeset
63 extern bool optimize_bb_for_size_p (const_basic_block);
kono
parents: 14
diff changeset
64 extern bool optimize_bb_for_speed_p (const_basic_block);
kono
parents: 14
diff changeset
65 extern optimization_type bb_optimization_type (const_basic_block);
kono
parents: 14
diff changeset
66 extern bool optimize_edge_for_size_p (edge);
kono
parents: 14
diff changeset
67 extern bool optimize_edge_for_speed_p (edge);
kono
parents: 14
diff changeset
68 extern bool optimize_insn_for_size_p (void);
kono
parents: 14
diff changeset
69 extern bool optimize_insn_for_speed_p (void);
kono
parents: 14
diff changeset
70 extern bool optimize_loop_for_size_p (struct loop *);
kono
parents: 14
diff changeset
71 extern bool optimize_loop_for_speed_p (struct loop *);
kono
parents: 14
diff changeset
72 extern bool optimize_loop_nest_for_speed_p (struct loop *);
kono
parents: 14
diff changeset
73 extern bool optimize_loop_nest_for_size_p (struct loop *);
kono
parents: 14
diff changeset
74 extern bool predictable_edge_p (edge);
kono
parents: 14
diff changeset
75 extern void rtl_profile_for_bb (basic_block);
kono
parents: 14
diff changeset
76 extern void rtl_profile_for_edge (edge);
kono
parents: 14
diff changeset
77 extern void default_rtl_profile (void);
kono
parents: 14
diff changeset
78 extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor);
kono
parents: 14
diff changeset
79 extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor);
kono
parents: 14
diff changeset
80 extern bool edge_probability_reliable_p (const_edge);
kono
parents: 14
diff changeset
81 extern bool br_prob_note_reliable_p (const_rtx);
kono
parents: 14
diff changeset
82 extern void predict_insn_def (rtx_insn *, enum br_predictor, enum prediction);
kono
parents: 14
diff changeset
83 extern void rtl_predict_edge (edge, enum br_predictor, int);
kono
parents: 14
diff changeset
84 extern void gimple_predict_edge (edge, enum br_predictor, int);
kono
parents: 14
diff changeset
85 extern void remove_predictions_associated_with_edge (edge);
kono
parents: 14
diff changeset
86 extern void predict_edge_def (edge, enum br_predictor, enum prediction);
kono
parents: 14
diff changeset
87 extern void invert_br_probabilities (rtx);
kono
parents: 14
diff changeset
88 extern void guess_outgoing_edge_probabilities (basic_block);
kono
parents: 14
diff changeset
89 extern void tree_guess_outgoing_edge_probabilities (basic_block);
kono
parents: 14
diff changeset
90 extern void tree_estimate_probability (bool);
kono
parents: 14
diff changeset
91 extern void handle_missing_profiles (void);
kono
parents: 14
diff changeset
92 extern bool counts_to_freqs (void);
kono
parents: 14
diff changeset
93 extern bool expensive_function_p (int);
kono
parents: 14
diff changeset
94 extern void estimate_bb_frequencies (bool);
kono
parents: 14
diff changeset
95 extern void compute_function_frequency (void);
kono
parents: 14
diff changeset
96 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
97 extern const char *predictor_name (enum br_predictor);
14
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
98 extern void rebuild_frequencies (void);
16
kono
parents: 14
diff changeset
99 extern void report_predictor_hitrates (void);
kono
parents: 14
diff changeset
100 extern void force_edge_cold (edge, bool);
kono
parents: 14
diff changeset
101 extern void propagate_unlikely_bbs_forward (void);
kono
parents: 14
diff changeset
102
kono
parents: 14
diff changeset
103 extern void add_reg_br_prob_note (rtx_insn *, profile_probability);
kono
parents: 14
diff changeset
104
kono
parents: 14
diff changeset
105 /* In ipa-pure-const.c */
kono
parents: 14
diff changeset
106 extern void warn_function_cold (tree);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 #endif /* GCC_PREDICT_H */