Mercurial > hg > CbC > CbC_gcc
comparison gcc/value-prof.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | 77e2b8dfacca |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Definitions for transformations based on profile information for values. | 1 /* Definitions for transformations based on profile information for values. |
2 Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. | 2 Copyright (C) 2003, 2004, 2005, 2007, 2008, 2010 |
3 Free Software Foundation, Inc. | |
3 | 4 |
4 This file is part of GCC. | 5 This file is part of GCC. |
5 | 6 |
6 GCC is free software; you can redistribute it and/or modify it under | 7 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 8 the terms of the GNU General Public License as published by the Free |
38 | 39 |
39 #define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER) | 40 #define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER) |
40 #define HIST_TYPE_FOR_COUNTER(COUNTER) \ | 41 #define HIST_TYPE_FOR_COUNTER(COUNTER) \ |
41 ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER)) | 42 ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER)) |
42 | 43 |
44 | |
43 /* The value to measure. */ | 45 /* The value to measure. */ |
44 struct histogram_value_t | 46 struct histogram_value_t |
45 { | 47 { |
46 struct | 48 struct |
47 { | 49 { |
68 DEF_VEC_P(histogram_value); | 70 DEF_VEC_P(histogram_value); |
69 DEF_VEC_ALLOC_P(histogram_value,heap); | 71 DEF_VEC_ALLOC_P(histogram_value,heap); |
70 | 72 |
71 typedef VEC(histogram_value,heap) *histogram_values; | 73 typedef VEC(histogram_value,heap) *histogram_values; |
72 | 74 |
73 /* Hooks registration. */ | 75 extern void gimple_find_values_to_profile (histogram_values *); |
74 extern void gimple_register_value_prof_hooks (void); | 76 extern bool gimple_value_profile_transformations (void); |
75 | |
76 /* IR-independent entry points. */ | |
77 extern void find_values_to_profile (histogram_values *); | |
78 extern bool value_profile_transformations (void); | |
79 | |
80 /* External declarations for edge-based profiling. */ | |
81 struct profile_hooks { | |
82 | |
83 /* Insert code to initialize edge profiler. */ | |
84 void (*init_edge_profiler) (void); | |
85 | |
86 /* Insert code to increment an edge count. */ | |
87 void (*gen_edge_profiler) (int, edge); | |
88 | |
89 /* Insert code to increment the interval histogram counter. */ | |
90 void (*gen_interval_profiler) (histogram_value, unsigned, unsigned); | |
91 | |
92 /* Insert code to increment the power of two histogram counter. */ | |
93 void (*gen_pow2_profiler) (histogram_value, unsigned, unsigned); | |
94 | |
95 /* Insert code to find the most common value. */ | |
96 void (*gen_one_value_profiler) (histogram_value, unsigned, unsigned); | |
97 | |
98 /* Insert code to find the most common value of a difference between two | |
99 evaluations of an expression. */ | |
100 void (*gen_const_delta_profiler) (histogram_value, unsigned, unsigned); | |
101 | |
102 /* Insert code to find the most common indirect call */ | |
103 void (*gen_ic_profiler) (histogram_value, unsigned, unsigned); | |
104 | |
105 /* Insert code to find the average value of an expression. */ | |
106 void (*gen_average_profiler) (histogram_value, unsigned, unsigned); | |
107 | |
108 /* Insert code to ior value of an expression. */ | |
109 void (*gen_ior_profiler) (histogram_value, unsigned, unsigned); | |
110 }; | |
111 | 77 |
112 histogram_value gimple_histogram_value (struct function *, gimple); | 78 histogram_value gimple_histogram_value (struct function *, gimple); |
113 histogram_value gimple_histogram_value_of_type (struct function *, gimple, | 79 histogram_value gimple_histogram_value_of_type (struct function *, gimple, |
114 enum hist_type); | 80 enum hist_type); |
115 void gimple_add_histogram_value (struct function *, gimple, histogram_value); | 81 void gimple_add_histogram_value (struct function *, gimple, histogram_value); |
121 void gimple_move_stmt_histograms (struct function *, gimple, gimple); | 87 void gimple_move_stmt_histograms (struct function *, gimple, gimple); |
122 void verify_histograms (void); | 88 void verify_histograms (void); |
123 void free_histograms (void); | 89 void free_histograms (void); |
124 void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *); | 90 void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *); |
125 | 91 |
92 /* In tree-profile.c. */ | |
93 extern void gimple_init_edge_profiler (void); | |
94 extern void gimple_gen_edge_profiler (int, edge); | |
95 extern void gimple_gen_interval_profiler (histogram_value, unsigned, unsigned); | |
96 extern void gimple_gen_pow2_profiler (histogram_value, unsigned, unsigned); | |
97 extern void gimple_gen_one_value_profiler (histogram_value, unsigned, unsigned); | |
98 extern void gimple_gen_ic_profiler (histogram_value, unsigned, unsigned); | |
99 extern void gimple_gen_ic_func_profiler (void); | |
100 extern void gimple_gen_const_delta_profiler (histogram_value, | |
101 unsigned, unsigned); | |
102 extern void gimple_gen_average_profiler (histogram_value, unsigned, unsigned); | |
103 extern void gimple_gen_ior_profiler (histogram_value, unsigned, unsigned); | |
104 | |
126 /* In profile.c. */ | 105 /* In profile.c. */ |
127 extern void init_branch_prob (void); | 106 extern void init_branch_prob (void); |
128 extern void branch_prob (void); | 107 extern void branch_prob (void); |
129 extern void end_branch_prob (void); | 108 extern void end_branch_prob (void); |
130 extern void tree_register_profile_hooks (void); | |
131 | |
132 /* In tree-profile.c. */ | |
133 extern struct profile_hooks tree_profile_hooks; | |
134 | 109 |
135 #endif /* GCC_VALUE_PROF_H */ | 110 #endif /* GCC_VALUE_PROF_H */ |
136 | 111 |