annotate gcc/profile.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
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 /* Header file for minimum-cost maximal flow routines used to smooth basic
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 block and edge frequency counts.
16
kono
parents: 0
diff changeset
3 Copyright (C) 2008-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 Contributed by Paul Yuan (yingbo.com@gmail.com)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 and Vinodha Ramasamy (vinodha@google.com).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 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
9 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
10 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
11 version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 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
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 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
16 for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 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
19 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #ifndef PROFILE_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 #define PROFILE_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 /* Additional information about edges. */
16
kono
parents: 0
diff changeset
26 struct edge_profile_info
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 unsigned int count_valid:1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 /* Is on the spanning tree. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 unsigned int on_tree:1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 /* Pretend this edge does not exist (it is abnormal and we've
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 inserted a fake to compensate). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 unsigned int ignore:1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
16
kono
parents: 0
diff changeset
38 #define EDGE_INFO(e) ((struct edge_profile_info *) (e)->aux)
kono
parents: 0
diff changeset
39
kono
parents: 0
diff changeset
40 /* Helpers annotating edges/basic blocks to GCOV counts. */
kono
parents: 0
diff changeset
41
kono
parents: 0
diff changeset
42 extern vec<gcov_type> bb_gcov_counts;
kono
parents: 0
diff changeset
43 extern hash_map<edge,gcov_type> *edge_gcov_counts;
kono
parents: 0
diff changeset
44
kono
parents: 0
diff changeset
45 inline gcov_type &
kono
parents: 0
diff changeset
46 edge_gcov_count (edge e)
kono
parents: 0
diff changeset
47 {
kono
parents: 0
diff changeset
48 bool existed;
kono
parents: 0
diff changeset
49 gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed);
kono
parents: 0
diff changeset
50 if (!existed)
kono
parents: 0
diff changeset
51 c = 0;
kono
parents: 0
diff changeset
52 return c;
kono
parents: 0
diff changeset
53 }
kono
parents: 0
diff changeset
54
kono
parents: 0
diff changeset
55 inline gcov_type &
kono
parents: 0
diff changeset
56 bb_gcov_count (basic_block bb)
kono
parents: 0
diff changeset
57 {
kono
parents: 0
diff changeset
58 return bb_gcov_counts[bb->index];
kono
parents: 0
diff changeset
59 }
kono
parents: 0
diff changeset
60
kono
parents: 0
diff changeset
61 typedef struct gcov_working_set_info gcov_working_set_t;
kono
parents: 0
diff changeset
62 extern gcov_working_set_t *find_working_set (unsigned pct_times_10);
kono
parents: 0
diff changeset
63 extern void add_working_set (gcov_working_set_t *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 /* Smoothes the initial assigned basic block and edge counts using
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 a minimum cost flow algorithm. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 extern void mcf_smooth_cfg (void);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
16
kono
parents: 0
diff changeset
69 extern gcov_type sum_edge_counts (vec<edge, va_gc> *edges);
kono
parents: 0
diff changeset
70
kono
parents: 0
diff changeset
71 extern void init_node_map (bool);
kono
parents: 0
diff changeset
72 extern void del_node_map (void);
kono
parents: 0
diff changeset
73
kono
parents: 0
diff changeset
74 extern void get_working_sets (void);
kono
parents: 0
diff changeset
75
kono
parents: 0
diff changeset
76 /* Counter summary from the last set of coverage counts read by
kono
parents: 0
diff changeset
77 profile.c. */
kono
parents: 0
diff changeset
78 extern const struct gcov_ctr_summary *profile_info;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 #endif /* PROFILE_H */