mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-25 23:21:42 +08:00
Rename profile_status_for_function to profile_status_for_fn.
gcc/ * basic-block.h (profile_status_for_function): Rename to... (profile_status_for_fn): ...this. * cfg.c (check_bb_profile): Update for renaming. * cgraphbuild.c (compute_call_stmt_bb_frequency): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * lto-streamer-out.c (output_cfg): Likewise. * predict.c (maybe_hot_frequency_p, maybe_hot_count_p, maybe_hot_bb_p, probably_never_executed) (handle_missing_profiles): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (copy_bb, initialize_cfun): Likewise. From-SVN: r205820
This commit is contained in:
parent
3e248e0691
commit
ea19eb9fba
@ -1,3 +1,18 @@
|
||||
2013-12-09 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* basic-block.h (profile_status_for_function): Rename to...
|
||||
(profile_status_for_fn): ...this.
|
||||
|
||||
* cfg.c (check_bb_profile): Update for renaming.
|
||||
* cgraphbuild.c (compute_call_stmt_bb_frequency): Likewise.
|
||||
* lto-streamer-in.c (input_cfg): Likewise.
|
||||
* lto-streamer-out.c (output_cfg): Likewise.
|
||||
* predict.c (maybe_hot_frequency_p, maybe_hot_count_p,
|
||||
maybe_hot_bb_p, probably_never_executed)
|
||||
(handle_missing_profiles): Likewise.
|
||||
* tree-cfg.c (init_empty_tree_cfg_for_function): Likewise.
|
||||
* tree-inline.c (copy_bb, initialize_cfun): Likewise.
|
||||
|
||||
2013-12-09 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* basic-block.h (label_to_block_map_for_function): Rename to...
|
||||
|
@ -319,7 +319,7 @@ struct GTY(()) control_flow_graph {
|
||||
#define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges)
|
||||
#define last_basic_block_for_fn(FN) ((FN)->cfg->x_last_basic_block)
|
||||
#define label_to_block_map_for_fn(FN) ((FN)->cfg->x_label_to_block_map)
|
||||
#define profile_status_for_function(FN) ((FN)->cfg->x_profile_status)
|
||||
#define profile_status_for_fn(FN) ((FN)->cfg->x_profile_status)
|
||||
|
||||
#define BASIC_BLOCK_FOR_FN(FN,N) \
|
||||
((*basic_block_info_for_fn (FN))[(N)])
|
||||
|
@ -408,7 +408,7 @@ check_bb_profile (basic_block bb, FILE * file, int indent, int flags)
|
||||
memset ((void *) s_indent, ' ', (size_t) indent);
|
||||
s_indent[indent] = '\0';
|
||||
|
||||
if (profile_status_for_function (fun) == PROFILE_ABSENT)
|
||||
if (profile_status_for_fn (fun) == PROFILE_ABSENT)
|
||||
return;
|
||||
|
||||
if (bb != EXIT_BLOCK_PTR_FOR_FN (fun))
|
||||
|
@ -208,7 +208,7 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb)
|
||||
(DECL_STRUCT_FUNCTION (decl))->frequency;
|
||||
int freq = bb->frequency;
|
||||
|
||||
if (profile_status_for_function (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
|
||||
if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
|
||||
return CGRAPH_FREQ_BASE;
|
||||
|
||||
if (!entry_freq)
|
||||
|
@ -632,8 +632,8 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
|
||||
init_empty_tree_cfg_for_function (fn);
|
||||
init_ssa_operands (fn);
|
||||
|
||||
profile_status_for_function (fn) = streamer_read_enum (ib, profile_status_d,
|
||||
PROFILE_LAST);
|
||||
profile_status_for_fn (fn) = streamer_read_enum (ib, profile_status_d,
|
||||
PROFILE_LAST);
|
||||
|
||||
bb_count = streamer_read_uhwi (ib);
|
||||
|
||||
|
@ -1630,7 +1630,7 @@ output_cfg (struct output_block *ob, struct function *fn)
|
||||
ob->main_stream = ob->cfg_stream;
|
||||
|
||||
streamer_write_enum (ob->main_stream, profile_status_d, PROFILE_LAST,
|
||||
profile_status_for_function (fn));
|
||||
profile_status_for_fn (fn));
|
||||
|
||||
/* Output the number of the highest basic block. */
|
||||
streamer_write_uhwi (ob, last_basic_block_for_fn (fn));
|
||||
|
@ -121,7 +121,7 @@ maybe_hot_frequency_p (struct function *fun, int freq)
|
||||
if (node->frequency == NODE_FREQUENCY_HOT)
|
||||
return true;
|
||||
}
|
||||
if (profile_status_for_function (fun) == PROFILE_ABSENT)
|
||||
if (profile_status_for_fn (fun) == PROFILE_ABSENT)
|
||||
return true;
|
||||
if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
|
||||
&& freq < (ENTRY_BLOCK_PTR_FOR_FN (fun)->frequency * 2 / 3))
|
||||
@ -164,7 +164,7 @@ set_hot_bb_threshold (gcov_type min)
|
||||
static inline bool
|
||||
maybe_hot_count_p (struct function *fun, gcov_type count)
|
||||
{
|
||||
if (fun && profile_status_for_function (fun) != PROFILE_READ)
|
||||
if (fun && profile_status_for_fn (fun) != PROFILE_READ)
|
||||
return true;
|
||||
/* Code executed at most once is not hot. */
|
||||
if (profile_info->runs >= count)
|
||||
@ -179,7 +179,7 @@ bool
|
||||
maybe_hot_bb_p (struct function *fun, const_basic_block bb)
|
||||
{
|
||||
gcc_checking_assert (fun);
|
||||
if (profile_status_for_function (fun) == PROFILE_READ)
|
||||
if (profile_status_for_fn (fun) == PROFILE_READ)
|
||||
return maybe_hot_count_p (fun, bb->count);
|
||||
return maybe_hot_frequency_p (fun, bb->frequency);
|
||||
}
|
||||
@ -239,7 +239,7 @@ probably_never_executed (struct function *fun,
|
||||
gcov_type count, int frequency)
|
||||
{
|
||||
gcc_checking_assert (fun);
|
||||
if (profile_status_for_function (fun) == PROFILE_READ)
|
||||
if (profile_status_for_fn (fun) == PROFILE_READ)
|
||||
{
|
||||
int unlikely_count_fraction = PARAM_VALUE (UNLIKELY_BB_COUNT_FRACTION);
|
||||
if (count * unlikely_count_fraction >= profile_info->runs)
|
||||
@ -2806,7 +2806,7 @@ drop_profile (struct cgraph_node *node, gcov_type call_count)
|
||||
node->name (), node->order);
|
||||
}
|
||||
|
||||
profile_status_for_function (fn)
|
||||
profile_status_for_fn (fn)
|
||||
= (flag_guess_branch_prob ? PROFILE_GUESSED : PROFILE_ABSENT);
|
||||
node->frequency
|
||||
= hot ? NODE_FREQUENCY_HOT : NODE_FREQUENCY_NORMAL;
|
||||
@ -2869,7 +2869,7 @@ handle_missing_profiles (void)
|
||||
if (callee->count > 0)
|
||||
continue;
|
||||
if (DECL_COMDAT (callee->decl) && fn && fn->cfg
|
||||
&& profile_status_for_function (fn) == PROFILE_READ)
|
||||
&& profile_status_for_fn (fn) == PROFILE_READ)
|
||||
{
|
||||
drop_profile (node, 0);
|
||||
worklist.safe_push (callee);
|
||||
|
@ -182,7 +182,7 @@ init_empty_tree_cfg_for_function (struct function *fn)
|
||||
{
|
||||
/* Initialize the basic block array. */
|
||||
init_flow (fn);
|
||||
profile_status_for_function (fn) = PROFILE_ABSENT;
|
||||
profile_status_for_fn (fn) = PROFILE_ABSENT;
|
||||
n_basic_blocks_for_fn (fn) = NUM_FIXED_BLOCKS;
|
||||
last_basic_block_for_fn (fn) = NUM_FIXED_BLOCKS;
|
||||
vec_alloc (basic_block_info_for_fn (fn), initial_cfg_capacity);
|
||||
|
@ -1792,7 +1792,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
|
||||
{
|
||||
edge->frequency = new_freq;
|
||||
if (dump_file
|
||||
&& profile_status_for_function (cfun) != PROFILE_ABSENT
|
||||
&& profile_status_for_fn (cfun) != PROFILE_ABSENT
|
||||
&& (edge_freq > edge->frequency + 10
|
||||
|| edge_freq < edge->frequency - 10))
|
||||
{
|
||||
@ -2208,7 +2208,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count)
|
||||
|
||||
init_empty_tree_cfg ();
|
||||
|
||||
profile_status_for_function (cfun) = profile_status_for_function (src_cfun);
|
||||
profile_status_for_fn (cfun) = profile_status_for_fn (src_cfun);
|
||||
ENTRY_BLOCK_PTR_FOR_FN (cfun)->count =
|
||||
(ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count * count_scale /
|
||||
REG_BR_PROB_BASE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user