diff gcc/profile.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
children 84e7813d76e9
line wrap: on
line diff
--- a/gcc/profile.h	Sun Aug 21 07:07:55 2011 +0900
+++ b/gcc/profile.h	Fri Oct 27 22:46:09 2017 +0900
@@ -1,7 +1,6 @@
 /* Header file for minimum-cost maximal flow routines used to smooth basic
    block and edge frequency counts.
-   Copyright (C) 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Contributed by Paul Yuan (yingbo.com@gmail.com)
        and Vinodha Ramasamy (vinodha@google.com).
 
@@ -24,7 +23,7 @@
 #define PROFILE_H
 
 /* Additional information about edges. */
-struct edge_info
+struct edge_profile_info
 {
   unsigned int count_valid:1;
 
@@ -36,12 +35,46 @@
   unsigned int ignore:1;
 };
 
-#define EDGE_INFO(e)  ((struct edge_info *) (e)->aux)
+#define EDGE_INFO(e)  ((struct edge_profile_info *) (e)->aux)
+
+/* Helpers annotating edges/basic blocks to GCOV counts.  */
+
+extern vec<gcov_type> bb_gcov_counts;
+extern hash_map<edge,gcov_type> *edge_gcov_counts;
+
+inline gcov_type &
+edge_gcov_count (edge e)
+{
+  bool existed;
+  gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed);
+  if (!existed)
+    c = 0;
+  return c;
+}
+
+inline gcov_type &
+bb_gcov_count (basic_block bb)
+{
+  return bb_gcov_counts[bb->index];
+}
+
+typedef struct gcov_working_set_info gcov_working_set_t;
+extern gcov_working_set_t *find_working_set (unsigned pct_times_10);
+extern void add_working_set (gcov_working_set_t *);
 
 /* Smoothes the initial assigned basic block and edge counts using
    a minimum cost flow algorithm. */
 extern void mcf_smooth_cfg (void);
 
-extern gcov_type sum_edge_counts (VEC (edge, gc) *edges);
+extern gcov_type sum_edge_counts (vec<edge, va_gc> *edges);
+
+extern void init_node_map (bool);
+extern void del_node_map (void);
+
+extern void get_working_sets (void);
+
+/* Counter summary from the last set of coverage counts read by
+   profile.c.  */
+extern const struct gcov_ctr_summary *profile_info;
 
 #endif /* PROFILE_H */