diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-09 20:38:21 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-09 20:38:21 +0000 |
commit | f26d858051109d44d39ec8f00137045e9058f173 (patch) | |
tree | 9f0c39edb95562e8ddd411354ba868a780f626cf /gcc/predict.c | |
parent | 37943f95a20e63578fd920823ccf09431b7ee213 (diff) | |
download | gcc-f26d858051109d44d39ec8f00137045e9058f173.tar.gz |
Eliminate profile_status macro.
gcc/
* basic-block.h (profile_status): Eliminate macro.
* cfgbuild.c (find_many_sub_basic_blocks): Eliminate use of
profile_status macro in favor of profile_status_for_fn, making
use of cfun explicit.
* cfghooks.c (account_profile_record): Likewise.
* cfgloopanal.c (single_likely_exit):
* cfgrtl.c (rtl_verify_edges, rtl_account_profile_record): Likewise.
* graphite.c (graphite_finalize):
* internal-fn.c (ubsan_expand_si_overflow_addsub_check,
ubsan_expand_si_overflow_neg_check,
ubsan_expand_si_overflow_mul_check): Likewise.
* ipa-split.c (consider_split, execute_split_functions):
* loop-unroll.c (decide_peel_simple):
* optabs.c (emit_cmp_and_jump_insn_1):
* predict.c (maybe_hot_edge_p, probably_never_executed,
predictable_edge_p, probability_reliable_p, gimple_predict_edge,
tree_estimate_probability_driver, estimate_bb_frequencies,
compute_function_frequency, rebuild_frequencies): Likewise.
* profile.c (compute_branch_probabilities): Likewise.
* tree-cfg.c (gimple_account_profile_record): Likewise.
* tree-inline.c (optimize_inline_calls): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205825 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index 1dec4dc92c7..6bb1b2cfef1 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -224,7 +224,7 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge) bool maybe_hot_edge_p (edge e) { - if (profile_status == PROFILE_READ) + if (profile_status_for_fn (cfun) == PROFILE_READ) return maybe_hot_count_p (cfun, e->count); return maybe_hot_frequency_p (cfun, EDGE_FREQUENCY (e)); } @@ -239,7 +239,7 @@ probably_never_executed (struct function *fun, gcov_type count, int frequency) { gcc_checking_assert (fun); - if (profile_status_for_fn (fun) == PROFILE_READ) + if (profile_status_for_fn (cfun) == PROFILE_READ) { int unlikely_count_fraction = PARAM_VALUE (UNLIKELY_BB_COUNT_FRACTION); if (count * unlikely_count_fraction >= profile_info->runs) @@ -438,7 +438,7 @@ optimize_loop_nest_for_size_p (struct loop *loop) bool predictable_edge_p (edge e) { - if (profile_status == PROFILE_ABSENT) + if (profile_status_for_fn (cfun) == PROFILE_ABSENT) return false; if ((e->probability <= PARAM_VALUE (PARAM_PREDICTABLE_BRANCH_OUTCOME) * REG_BR_PROB_BASE / 100) @@ -539,8 +539,8 @@ gimple_predicted_by_p (const_basic_block bb, enum br_predictor predictor) static bool probability_reliable_p (int prob) { - return (profile_status == PROFILE_READ - || (profile_status == PROFILE_GUESSED + return (profile_status_for_fn (cfun) == PROFILE_READ + || (profile_status_for_fn (cfun) == PROFILE_GUESSED && (prob <= HITRATE (1) || prob >= HITRATE (99)))); } @@ -610,7 +610,7 @@ rtl_predict_edge (edge e, enum br_predictor predictor, int probability) void gimple_predict_edge (edge e, enum br_predictor predictor, int probability) { - gcc_assert (profile_status != PROFILE_GUESSED); + gcc_assert (profile_status_for_fn (cfun) != PROFILE_GUESSED); if ((e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun) && EDGE_COUNT (e->src->succs) > 1) && flag_guess_branch_prob && optimize) @@ -2443,8 +2443,8 @@ tree_estimate_probability_driver (void) loop_optimizer_finalize (); if (dump_file && (dump_flags & TDF_DETAILS)) gimple_dump_cfg (dump_file, dump_flags); - if (profile_status == PROFILE_ABSENT) - profile_status = PROFILE_GUESSED; + if (profile_status_for_fn (cfun) == PROFILE_ABSENT) + profile_status_for_fn (cfun) = PROFILE_GUESSED; return 0; } @@ -2954,7 +2954,7 @@ estimate_bb_frequencies (bool force) basic_block bb; sreal freq_max; - if (force || profile_status != PROFILE_READ || !counts_to_freqs ()) + if (force || profile_status_for_fn (cfun) != PROFILE_READ || !counts_to_freqs ()) { static int real_values_initialized = 0; @@ -3030,7 +3030,7 @@ compute_function_frequency (void) if (DECL_STATIC_DESTRUCTOR (current_function_decl)) node->only_called_at_exit = true; - if (profile_status != PROFILE_READ) + if (profile_status_for_fn (cfun) != PROFILE_READ) { int flags = flags_from_decl_or_type (current_function_decl); if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl)) @@ -3189,8 +3189,8 @@ rebuild_frequencies (void) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb) count_max = MAX (bb->count, count_max); - if (profile_status == PROFILE_GUESSED - || (profile_status == PROFILE_READ && count_max < REG_BR_PROB_BASE/10)) + if (profile_status_for_fn (cfun) == PROFILE_GUESSED + || (profile_status_for_fn (cfun) == PROFILE_READ && count_max < REG_BR_PROB_BASE/10)) { loop_optimizer_init (0); add_noreturn_fake_exit_edges (); @@ -3200,7 +3200,7 @@ rebuild_frequencies (void) remove_fake_exit_edges (); loop_optimizer_finalize (); } - else if (profile_status == PROFILE_READ) + else if (profile_status_for_fn (cfun) == PROFILE_READ) counts_to_freqs (); else gcc_unreachable (); |