comparison gcc/profile.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
children 84e7813d76e9
comparison
equal deleted inserted replaced
15:561a7518be6b 16:04ced10e8804
1 /* Header file for minimum-cost maximal flow routines used to smooth basic 1 /* Header file for minimum-cost maximal flow routines used to smooth basic
2 block and edge frequency counts. 2 block and edge frequency counts.
3 Copyright (C) 2008 3 Copyright (C) 2008-2017 Free Software Foundation, Inc.
4 Free Software Foundation, Inc.
5 Contributed by Paul Yuan (yingbo.com@gmail.com) 4 Contributed by Paul Yuan (yingbo.com@gmail.com)
6 and Vinodha Ramasamy (vinodha@google.com). 5 and Vinodha Ramasamy (vinodha@google.com).
7 6
8 This file is part of GCC. 7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
22 21
23 #ifndef PROFILE_H 22 #ifndef PROFILE_H
24 #define PROFILE_H 23 #define PROFILE_H
25 24
26 /* Additional information about edges. */ 25 /* Additional information about edges. */
27 struct edge_info 26 struct edge_profile_info
28 { 27 {
29 unsigned int count_valid:1; 28 unsigned int count_valid:1;
30 29
31 /* Is on the spanning tree. */ 30 /* Is on the spanning tree. */
32 unsigned int on_tree:1; 31 unsigned int on_tree:1;
34 /* Pretend this edge does not exist (it is abnormal and we've 33 /* Pretend this edge does not exist (it is abnormal and we've
35 inserted a fake to compensate). */ 34 inserted a fake to compensate). */
36 unsigned int ignore:1; 35 unsigned int ignore:1;
37 }; 36 };
38 37
39 #define EDGE_INFO(e) ((struct edge_info *) (e)->aux) 38 #define EDGE_INFO(e) ((struct edge_profile_info *) (e)->aux)
39
40 /* Helpers annotating edges/basic blocks to GCOV counts. */
41
42 extern vec<gcov_type> bb_gcov_counts;
43 extern hash_map<edge,gcov_type> *edge_gcov_counts;
44
45 inline gcov_type &
46 edge_gcov_count (edge e)
47 {
48 bool existed;
49 gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed);
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
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 *);
40 64
41 /* Smoothes the initial assigned basic block and edge counts using 65 /* Smoothes the initial assigned basic block and edge counts using
42 a minimum cost flow algorithm. */ 66 a minimum cost flow algorithm. */
43 extern void mcf_smooth_cfg (void); 67 extern void mcf_smooth_cfg (void);
44 68
45 extern gcov_type sum_edge_counts (VEC (edge, gc) *edges); 69 extern gcov_type sum_edge_counts (vec<edge, va_gc> *edges);
70
71 extern void init_node_map (bool);
72 extern void del_node_map (void);
73
74 extern void get_working_sets (void);
75
76 /* Counter summary from the last set of coverage counts read by
77 profile.c. */
78 extern const struct gcov_ctr_summary *profile_info;
46 79
47 #endif /* PROFILE_H */ 80 #endif /* PROFILE_H */