diff options
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index ea106e0..824ab25 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -1425,11 +1425,10 @@ split_block_before_cond_jump (basic_block bb) /* Work-horse for passes.c:check_profile_consistency. Do book-keeping of the CFG 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. */ void -account_profile_record (struct profile_record *record, int after_pass) +profile_record_check_consistency (profile_record *record) { basic_block bb; edge_iterator ei; @@ -1445,26 +1444,49 @@ account_profile_record (struct profile_record *record, int after_pass) sum += e->probability; if (EDGE_COUNT (bb->succs) && sum.differs_from_p (profile_probability::always ())) - record->num_mismatched_freq_out[after_pass]++; + record->num_mismatched_freq_out++; profile_count lsum = profile_count::zero (); FOR_EACH_EDGE (e, ei, bb->succs) lsum += e->count (); if (EDGE_COUNT (bb->succs) && (lsum.differs_from_p (bb->count))) - record->num_mismatched_count_out[after_pass]++; + record->num_mismatched_count_out++; } if (bb != ENTRY_BLOCK_PTR_FOR_FN (cfun) && profile_status_for_fn (cfun) != PROFILE_ABSENT) { + profile_probability sum = profile_probability::never (); profile_count lsum = profile_count::zero (); FOR_EACH_EDGE (e, ei, bb->preds) - lsum += e->count (); + { + sum += e->probability; + lsum += e->count (); + } + if (EDGE_COUNT (bb->preds) + && sum.differs_from_p (profile_probability::always ())) + record->num_mismatched_freq_in++; if (lsum.differs_from_p (bb->count)) - record->num_mismatched_count_in[after_pass]++; + record->num_mismatched_count_in++; } if (bb == ENTRY_BLOCK_PTR_FOR_FN (cfun) || bb == EXIT_BLOCK_PTR_FOR_FN (cfun)) continue; gcc_assert (cfg_hooks->account_profile_record); - cfg_hooks->account_profile_record (bb, after_pass, record); + cfg_hooks->account_profile_record (bb, record); + } +} + +/* Work-horse for passes.c:acount_profile. + Do book-keeping of the CFG for the profile accounting. + Store the counting in RECORD. */ + +void +profile_record_account_profile (profile_record *record) +{ + basic_block bb; + + FOR_ALL_BB_FN (bb, cfun) + { + gcc_assert (cfg_hooks->account_profile_record); + cfg_hooks->account_profile_record (bb, record); } } |