Mercurial > hg > CbC > CbC_gcc
annotate gcc/value-prof.h @ 108:7ad14f446135
add CbC-example/rectypeTest/
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Jun 2012 20:30:24 +0900 |
parents | f6334be47118 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 /* Definitions for transformations based on profile information for values. |
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
|
2 Copyright (C) 2003, 2004, 2005, 2007, 2008, 2010 |
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
|
3 Free Software Foundation, Inc. |
0 | 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 3, 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 COPYING3. If not see | |
19 <http://www.gnu.org/licenses/>. */ | |
20 | |
21 #ifndef GCC_VALUE_PROF_H | |
22 #define GCC_VALUE_PROF_H | |
23 | |
24 /* Supported histogram types. */ | |
25 enum hist_type | |
26 { | |
27 HIST_TYPE_INTERVAL, /* Measures histogram of values inside a specified | |
28 interval. */ | |
29 HIST_TYPE_POW2, /* Histogram of power of 2 values. */ | |
30 HIST_TYPE_SINGLE_VALUE, /* Tries to identify the value that is (almost) | |
31 always constant. */ | |
32 HIST_TYPE_CONST_DELTA, /* Tries to identify the (almost) always constant | |
33 difference between two evaluations of a value. */ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
34 HIST_TYPE_INDIR_CALL, /* Tries to identify the function that is (almost) |
0 | 35 called in indirect call */ |
36 HIST_TYPE_AVERAGE, /* Compute average value (sum of all values). */ | |
37 HIST_TYPE_IOR /* Used to compute expected alignment. */ | |
38 }; | |
39 | |
40 #define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER) | |
41 #define HIST_TYPE_FOR_COUNTER(COUNTER) \ | |
42 ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER)) | |
43 | |
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
|
44 |
0 | 45 /* The value to measure. */ |
46 struct histogram_value_t | |
47 { | |
48 struct | |
49 { | |
50 tree value; /* The value to profile. */ | |
51 gimple stmt; /* Insn containing the value. */ | |
52 gcov_type *counters; /* Pointer to first counter. */ | |
53 struct histogram_value_t *next; /* Linked list pointer. */ | |
54 } hvalue; | |
55 enum hist_type type; /* Type of information to measure. */ | |
56 unsigned n_counters; /* Number of required counters. */ | |
57 union | |
58 { | |
59 struct | |
60 { | |
61 int int_start; /* First value in interval. */ | |
62 unsigned int steps; /* Number of values in it. */ | |
63 } intvl; /* Interval histogram data. */ | |
64 } hdata; /* Profiled information specific data. */ | |
65 }; | |
66 | |
67 typedef struct histogram_value_t *histogram_value; | |
68 typedef const struct histogram_value_t *const_histogram_value; | |
69 | |
70 DEF_VEC_P(histogram_value); | |
71 DEF_VEC_ALLOC_P(histogram_value,heap); | |
72 | |
73 typedef VEC(histogram_value,heap) *histogram_values; | |
74 | |
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
|
75 extern void gimple_find_values_to_profile (histogram_values *); |
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
|
76 extern bool gimple_value_profile_transformations (void); |
0 | 77 |
78 histogram_value gimple_histogram_value (struct function *, gimple); | |
79 histogram_value gimple_histogram_value_of_type (struct function *, gimple, | |
80 enum hist_type); | |
81 void gimple_add_histogram_value (struct function *, gimple, histogram_value); | |
82 void dump_histograms_for_stmt (struct function *, FILE *, gimple); | |
83 void gimple_remove_histogram_value (struct function *, gimple, histogram_value); | |
84 void gimple_remove_stmt_histograms (struct function *, gimple); | |
85 void gimple_duplicate_stmt_histograms (struct function *, gimple, | |
86 struct function *, gimple); | |
87 void gimple_move_stmt_histograms (struct function *, gimple, gimple); | |
88 void verify_histograms (void); | |
89 void free_histograms (void); | |
90 void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *); | |
91 | |
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
|
92 /* In tree-profile.c. */ |
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
|
93 extern void gimple_init_edge_profiler (void); |
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
|
94 extern void gimple_gen_edge_profiler (int, edge); |
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
|
95 extern void gimple_gen_interval_profiler (histogram_value, unsigned, unsigned); |
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
|
96 extern void gimple_gen_pow2_profiler (histogram_value, unsigned, unsigned); |
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
|
97 extern void gimple_gen_one_value_profiler (histogram_value, unsigned, unsigned); |
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
|
98 extern void gimple_gen_ic_profiler (histogram_value, unsigned, unsigned); |
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 gimple_gen_ic_func_profiler (void); |
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
|
100 extern void gimple_gen_const_delta_profiler (histogram_value, |
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
|
101 unsigned, unsigned); |
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
|
102 extern void gimple_gen_average_profiler (histogram_value, unsigned, unsigned); |
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
|
103 extern void gimple_gen_ior_profiler (histogram_value, unsigned, unsigned); |
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
|
104 |
0 | 105 /* In profile.c. */ |
106 extern void init_branch_prob (void); | |
107 extern void branch_prob (void); | |
108 extern void end_branch_prob (void); | |
109 | |
110 #endif /* GCC_VALUE_PROF_H */ | |
111 |