]>
Commit | Line | Data |
---|---|---|
4d0f95c0 | 1 | /* Header file for minimum-cost maximal flow routines used to smooth basic |
2 | block and edge frequency counts. | |
fbd26352 | 3 | Copyright (C) 2008-2019 Free Software Foundation, Inc. |
4d0f95c0 | 4 | Contributed by Paul Yuan (yingbo.com@gmail.com) |
5 | and Vinodha Ramasamy (vinodha@google.com). | |
6 | ||
7 | This file is part of GCC. | |
8 | GCC is free software; you can redistribute it and/or modify it under | |
9 | the terms of the GNU General Public License as published by the Free | |
10 | Software Foundation; either version 3, or (at your option) any later | |
11 | version. | |
12 | ||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GCC; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. */ | |
21 | ||
22 | #ifndef PROFILE_H | |
23 | #define PROFILE_H | |
24 | ||
25 | /* Additional information about edges. */ | |
9908fe4d | 26 | struct edge_profile_info |
4d0f95c0 | 27 | { |
28 | unsigned int count_valid:1; | |
29 | ||
30 | /* Is on the spanning tree. */ | |
31 | unsigned int on_tree:1; | |
32 | ||
33 | /* Pretend this edge does not exist (it is abnormal and we've | |
34 | inserted a fake to compensate). */ | |
35 | unsigned int ignore:1; | |
36 | }; | |
37 | ||
9908fe4d | 38 | #define EDGE_INFO(e) ((struct edge_profile_info *) (e)->aux) |
4d0f95c0 | 39 | |
db9cef39 | 40 | /* Helpers annotating edges/basic blocks to GCOV counts. */ |
41 | ||
42 | extern vec<gcov_type> bb_gcov_counts; | |
25689b69 | 43 | extern hash_map<edge,gcov_type> *edge_gcov_counts; |
db9cef39 | 44 | |
45 | inline gcov_type & | |
46 | edge_gcov_count (edge e) | |
47 | { | |
48 | bool existed; | |
25689b69 | 49 | gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed); |
db9cef39 | 50 | if (!existed) |
51 | c = 0; | |
52 | return c; | |
53 | } | |
54 | ||
55 | inline gcov_type & | |
56 | bb_gcov_count (basic_block bb) | |
57 | { | |
58 | return bb_gcov_counts[bb->index]; | |
59 | } | |
60 | ||
e5a23585 | 61 | typedef struct gcov_working_set_info gcov_working_set_t; |
62 | extern gcov_working_set_t *find_working_set (unsigned pct_times_10); | |
63 | extern void add_working_set (gcov_working_set_t *); | |
64 | ||
4d0f95c0 | 65 | /* Smoothes the initial assigned basic block and edge counts using |
66 | a minimum cost flow algorithm. */ | |
67 | extern void mcf_smooth_cfg (void); | |
68 | ||
f1f41a6c | 69 | extern gcov_type sum_edge_counts (vec<edge, va_gc> *edges); |
4d0f95c0 | 70 | |
fe37be54 | 71 | extern void init_node_map (bool); |
1ad3e14c | 72 | extern void del_node_map (void); |
73 | ||
8515a84d | 74 | extern void get_working_sets (void); |
e3ba12e8 | 75 | |
886c1262 | 76 | /* Counter summary from the last set of coverage counts read by |
77 | profile.c. */ | |
56621355 | 78 | extern struct gcov_summary *profile_info; |
886c1262 | 79 | |
4d0f95c0 | 80 | #endif /* PROFILE_H */ |