aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-11-13 16:06:54 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-11-13 15:06:54 +0000
commit160576e1ac9bbee90af9e09e1507f64d58473358 (patch)
tree6541a5a15b3bc6f875bc04aac0025283eb9d84a6 /gcc/cfgrtl.c
parente4db210dd8683bf7b2a8ea828d6ea0b18967630a (diff)
downloadgcc-160576e1ac9bbee90af9e09e1507f64d58473358.zip
gcc-160576e1ac9bbee90af9e09e1507f64d58473358.tar.gz
gcc-160576e1ac9bbee90af9e09e1507f64d58473358.tar.bz2
Improve -fprofile-report.
2018-11-13 Martin Liska <mliska@suse.cz> PR tree-optimization/87885 * cfghooks.c (account_profile_record): Rename to ... (profile_record_check_consistency): ... this. Calculate missing num_mismatched_freq_in. (profile_record_account_profile): New function that calculates time and size of a function. * cfghooks.h (struct profile_record): Remove all tuples. (struct cfg_hooks): Remove after_pass flag. (account_profile_record): Rename to ... (profile_record_check_consistency): ... this. (profile_record_account_profile): New. * cfgrtl.c (rtl_account_profile_record): Remove after_pass flag. * passes.c (check_profile_consistency): Do only checking. (account_profile): Calculate size and time of function only. (pass_manager::dump_profile_report): Reformat output. (execute_one_ipa_transform_pass): Call consistency check before clean upand call account_profile after a clean up is done. (execute_one_pass): Call check_profile_consistency and account_profile instead of using after_pass flag.. * tree-cfg.c (gimple_account_profile_record): Likewise. From-SVN: r266074
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 3b1931d..741a312 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -5068,22 +5068,20 @@ rtl_duplicate_bb (basic_block bb)
}
/* Do book-keeping of basic block BB for the profile consistency checker.
- If AFTER_PASS is 0, do pre-pass accounting, or if AFTER_PASS is 1
- then do post-pass accounting. Store the counting in RECORD. */
+ Store the counting in RECORD. */
static void
-rtl_account_profile_record (basic_block bb, int after_pass,
- struct profile_record *record)
+rtl_account_profile_record (basic_block bb, struct profile_record *record)
{
rtx_insn *insn;
FOR_BB_INSNS (bb, insn)
if (INSN_P (insn))
{
- record->size[after_pass] += insn_cost (insn, false);
+ record->size += insn_cost (insn, false);
if (bb->count.initialized_p ())
- record->time[after_pass]
+ record->time
+= insn_cost (insn, true) * bb->count.to_gcov_type ();
else if (profile_status_for_fn (cfun) == PROFILE_GUESSED)
- record->time[after_pass]
+ record->time
+= insn_cost (insn, true) * bb->count.to_frequency (cfun);
}
}