summaryrefslogtreecommitdiff
path: root/gcc/basic-block.h
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-10-09 20:37:11 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-10-09 20:37:11 +0000
commitaa4723d7f56dd0c690c514b50c917c827a3d56dd (patch)
tree784313dcb1809538918556fac30dbf561f9d8332 /gcc/basic-block.h
parentca4277584fa6e046279dd3e75fdaa53881d9eaf3 (diff)
downloadgcc-aa4723d7f56dd0c690c514b50c917c827a3d56dd.tar.gz
* basic-block. (profile_record): New struct, moved from passes.c.
* cfghooks.h (struct cfg_hooks) <account_profile_record>: New hook. (account_profile_record): New prototype. * cfghooks.c (account_profile_record): New function. * tree-cfg.c (gimple_account_profile_record): New function (gimple_cfg_hooks): Add it. * cfgrtl.c (rtl_account_profile_record): New function (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Add it. * passes.c (check_profile_consistency): Simplify. Move IR-dependent code around using cfghooks machinery. From-SVN: r192271
Diffstat (limited to 'gcc/basic-block.h')
-rw-r--r--gcc/basic-block.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index a5491b03011..61351fb248d 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -101,6 +101,37 @@ typedef struct gcov_working_set_info
gcov_type min_counter;
} gcov_working_set_t;
+/* Structure to gather statistic about profile consistency, per pass.
+ An array of this structure, indexed by pass static number, is allocated
+ in passes.c. The structure is defined here so that different CFG modes
+ can do their book-keeping via CFG hooks.
+
+ For every field[2], field[0] is the count before the pass runs, and
+ field[1] is the post-pass count. This allows us to monitor the effect
+ of each individual pass on the profile consistency.
+
+ This structure is not supposed to be used by anything other than passes.c
+ and one CFG hook per CFG mode. */
+struct profile_record
+{
+ /* The number of basic blocks where sum(freq) of the block's predecessors
+ doesn't match reasonably well with the incoming frequency. */
+ int num_mismatched_freq_in[2];
+ /* Likewise for a basic block's successors. */
+ int num_mismatched_freq_out[2];
+ /* The number of basic blocks where sum(count) of the block's predecessors
+ doesn't match reasonably well with the incoming frequency. */
+ int num_mismatched_count_in[2];
+ /* Likewise for a basic block's successors. */
+ int num_mismatched_count_out[2];
+ /* A weighted cost of the run-time of the function body. */
+ gcov_type time[2];
+ /* A weighted cost of the size of the function body. */
+ int size[2];
+ /* True iff this pass actually was run. */
+ bool run;
+};
+
/* Declared in cfgloop.h. */
struct loop;