00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GCC_VALUE_PROF_H
00022 #define GCC_VALUE_PROF_H
00023
00024
00025 enum hist_type
00026 {
00027 HIST_TYPE_INTERVAL,
00028
00029 HIST_TYPE_POW2,
00030 HIST_TYPE_SINGLE_VALUE,
00031
00032 HIST_TYPE_CONST_DELTA
00033
00034 };
00035
00036 #define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER)
00037 #define HIST_TYPE_FOR_COUNTER(COUNTER) \
00038 ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER))
00039
00040
00041
00042 struct histogram_value_t GTY(())
00043 {
00044 PTR GTY ((skip (""))) value;
00045 enum machine_mode mode;
00046 PTR GTY ((skip (""))) seq;
00047
00048 PTR GTY ((skip (""))) insn;
00049 enum hist_type type;
00050 unsigned n_counters;
00051 union
00052 {
00053 struct
00054 {
00055 int int_start;
00056 int steps;
00057 int may_be_less;
00058 int may_be_more;
00059 } intvl;
00060 struct
00061 {
00062 int may_be_other;
00063 } pow2;
00064 } hdata;
00065 };
00066
00067 typedef struct histogram_value_t *histogram_value;
00068
00069 DEF_VEC_GC_P(histogram_value);
00070
00071 typedef VEC(histogram_value) *histogram_values;
00072
00073
00074 extern void rtl_register_value_prof_hooks (void);
00075 extern void tree_register_value_prof_hooks (void);
00076
00077
00078 extern void find_values_to_profile (histogram_values *);
00079 extern bool value_profile_transformations (void);
00080
00081
00082 struct profile_hooks {
00083
00084
00085 void (*init_edge_profiler) (void);
00086
00087
00088 void (*gen_edge_profiler) (int, edge);
00089
00090
00091 void (*gen_interval_profiler) (histogram_value, unsigned, unsigned);
00092
00093
00094 void (*gen_pow2_profiler) (histogram_value, unsigned, unsigned);
00095
00096
00097 void (*gen_one_value_profiler) (histogram_value, unsigned, unsigned);
00098
00099
00100
00101 void (*gen_const_delta_profiler) (histogram_value, unsigned, unsigned);
00102 FILE * (*profile_dump_file) (void);
00103 };
00104
00105
00106 extern void init_branch_prob (void);
00107 extern void branch_prob (void);
00108 extern void end_branch_prob (void);
00109 extern void tree_register_profile_hooks (void);
00110 extern void rtl_register_profile_hooks (void);
00111
00112
00113 extern struct profile_hooks tree_profile_hooks;
00114
00115
00116 extern struct profile_hooks rtl_profile_hooks;
00117
00118 #endif
00119