GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | histogram_value_t |
Typedefs | |
typedef struct histogram_value_t * | histogram_value |
typedef struct histogram_value_t * | const_histogram_value |
typedef vec< histogram_value > | histogram_values |
Enumerations | |
enum | hist_type { HIST_TYPE_INTERVAL, HIST_TYPE_POW2, HIST_TYPE_SINGLE_VALUE, HIST_TYPE_CONST_DELTA, HIST_TYPE_INDIR_CALL, HIST_TYPE_AVERAGE, HIST_TYPE_IOR, HIST_TYPE_MAX } |
typedef struct histogram_value_t* const_histogram_value |
typedef struct histogram_value_t* histogram_value |
typedef vec<histogram_value> histogram_values |
enum hist_type |
void branch_prob | ( | void | ) |
Instrument and/or analyze program behavior based on program the CFG. This function creates a representation of the control flow graph (of the function being compiled) that is suitable for the instrumentation of edges and/or converting measured edge counts to counts on the complete CFG. When FLAG_PROFILE_ARCS is nonzero, this function instruments the edges in the flow graph that are needed to reconstruct the dynamic behavior of the flow graph. This data is written to the gcno file for gcov. When FLAG_BRANCH_PROBABILITIES is nonzero, this function reads auxiliary information from the gcda file containing edge count information from previous executions of the function being compiled. In this case, the control flow graph is annotated with actual execution counts by compute_branch_probabilities(). Main entry point of this file.
References add_noreturn_fake_exit_edges(), alloc_aux_for_edges(), BUILT_IN_NORMAL, compact_blocks(), compute_branch_probabilities(), compute_value_histograms(), edge_def::count, coverage_begin_function(), coverage_compute_cfg_checksum(), coverage_compute_lineno_checksum(), coverage_counter_alloc(), coverage_end_function(), create_edge_list(), curr_location, current_function_decl, edge_def::dest, dump_file, expand_location(), find_spanning_tree(), first, edge_def::flags, flow_call_edges_add(), free_aux_for_edges(), free_edge_list(), gcov_write_length(), gcov_write_string(), gcov_write_tag(), gcov_write_unsigned(), gimple_call_flags(), gimple_call_fndecl(), gimple_filename(), gimple_find_values_to_profile(), gimple_has_location(), gimple_init_edge_profiler(), gimple_lineno(), gimple_location(), edge_def::goto_locus, gsi_after_labels(), gsi_commit_edge_inserts(), gsi_end_p(), gsi_last_nondebug_bb(), gsi_next(), gsi_next_nondebug(), gsi_prev_nondebug(), gsi_start_bb(), gsi_stmt(), edge_info::ignore, basic_block_def::index, instrument_edges(), instrument_values(), is_gimple_call(), is_gimple_debug(), last, make_edge(), basic_block_def::next_bb, edge_list::num_edges, offset, edge_info::on_tree, output_location(), basic_block_def::preds, remove_fake_edges(), single_succ_edge(), single_succ_p(), split_block_after_labels(), split_edge(), edge_def::src, basic_block_def::succs, total_num_blocks, total_num_edges, total_num_edges_ignored, total_num_edges_instrumented, and total_num_times_called.
Referenced by tree_profiling().
void end_branch_prob | ( | void | ) |
Performs file-level cleanup after branch-prob processing is completed.
References dump_file, total_hist_br_prob, total_num_blocks, total_num_blocks_created, total_num_branches, total_num_edges, total_num_edges_ignored, total_num_edges_instrumented, total_num_passes, and total_num_times_called.
Referenced by gcc::pass_manager::finish_optimization_passes().
|
read |
void free_histograms | ( | void | ) |
References cfun, and free_hist().
Referenced by gimple_expand_cfg(), and release_function_body().
void gimple_add_histogram_value | ( | struct function * | fun, |
gimple | stmt, | ||
histogram_value | hist | ||
) |
Add histogram for STMT.
References gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, and set_histogram_value().
Referenced by compute_value_histograms(), gimple_duplicate_stmt_histograms(), and stream_in_histogram_value().
void gimple_duplicate_stmt_histograms | ( | struct function * | fun, |
gimple | stmt, | ||
struct function * | ofun, | ||
gimple | ostmt | ||
) |
Duplicate all histograms associates with OSTMT to STMT.
References histogram_value_t::counters, gimple_add_histogram_value(), gimple_alloc_histogram_value(), gimple_histogram_value(), histogram_value_t::hvalue, memcpy(), histogram_value_t::n_counters, histogram_value_t::next, histogram_value_t::stmt, and histogram_value_t::type.
Referenced by copy_bb(), gimple_duplicate_bb(), graphite_copy_stmts_from_block(), gsi_replace(), and move_block_to_fn().
void gimple_find_values_to_profile | ( | histogram_values * | ) |
void gimple_gen_average_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
void gimple_gen_const_delta_profiler | ( | histogram_value | value, |
unsigned | tag, | ||
unsigned | base | ||
) |
Output instructions as GIMPLE trees for code to find the most common value of a difference between two evaluations of an expression. VALUE is the expression whose value is profiled. TAG is the tag of the section for counters, BASE is offset of the counter position.
References internal_error().
Referenced by instrument_values().
void gimple_gen_edge_profiler | ( | int | , |
edge | |||
) |
void gimple_gen_ic_func_profiler | ( | void | ) |
Output instructions as GIMPLE trees for code to find the most common called function in indirect call. Insert instructions at the beginning of every possible called function.
References build_addr(), build_int_cst(), build_pointer_type(), cgraph_get_node(), cgraph_only_called_directly_p(), current_function_decl, force_gimple_operand_gsi(), gcov_type_node, gimple_build_call(), gimple_init_edge_profiler(), gsi_after_labels(), gsi_insert_before(), GSI_SAME_STMT, ic_gcov_type_ptr_var, ic_void_ptr_var, cgraph_node::profile_id, single_succ_edge(), split_edge(), and tree_indirect_call_profiler_fn.
Referenced by tree_profiling().
void gimple_gen_ic_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
void gimple_gen_interval_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
void gimple_gen_ior_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
void gimple_gen_one_value_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
void gimple_gen_pow2_profiler | ( | histogram_value | , |
unsigned | , | ||
unsigned | |||
) |
histogram_value gimple_histogram_value | ( | struct function * | , |
gimple | |||
) |
histogram_value gimple_histogram_value_of_type | ( | struct function * | fun, |
gimple | stmt, | ||
enum hist_type | type | ||
) |
Lookup histogram of type TYPE in the STMT.
References gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, and histogram_value_t::type.
Referenced by gimple_divmod_fixed_value_transform(), gimple_ic_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), ipa_profile_generate_summary(), and stringop_block_profile().
gimple gimple_ic | ( | gimple | icall_stmt, |
struct cgraph_node * | direct_call, | ||
int | prob, | ||
gcov_type | count, | ||
gcov_type | all | ||
) |
Do transformation if (actual_callee_address == address_of_most_common_function/method) do direct call else old call
References add_phi_arg(), add_stmt_to_eh_lp(), build_addr(), build_pointer_type(), count, edge_def::count, basic_block_def::count, create_phi_node(), current_function_decl, symtab_node_base::decl, edge_def::dest, duplicate_ssa_name(), find_fallthru_edge(), edge_def::flags, flags_from_decl_or_type(), gimple_bb(), gimple_build_cond(), gimple_call_fn(), gimple_call_lhs(), gimple_call_set_fndecl(), gimple_call_set_lhs(), gimple_copy(), gimple_set_vdef(), gimple_set_vuse(), gsi_end_p(), gsi_for_stmt(), gsi_insert_before(), gsi_next(), GSI_SAME_STMT, gsi_start_phis(), gsi_stmt(), lookup_stmt_eh_lp(), make_edge(), make_temp_ssa_name(), prob, edge_def::probability, remove_edge(), single_pred_edge(), split_block(), split_edge(), stmt_could_throw_p(), stmt_ends_bb_p(), basic_block_def::succs, cgraph_node::symbol, unshare_expr(), and update_stmt().
Referenced by cgraph_redirect_edge_call_stmt_to_callee().
void gimple_init_edge_profiler | ( | void | ) |
In tree-profile.c.
Create the type and function decls for the interface with gcov.
References build_fn_decl(), build_function_type_list(), build_pointer_type(), gcov_type_node, get_gcov_type(), get_identifier(), init_ic_make_global_vars(), ptr_void, tree_average_profiler_fn, tree_indirect_call_profiler_fn, tree_interval_profiler_fn, tree_ior_profiler_fn, tree_one_value_profiler_fn, and tree_pow2_profiler_fn.
Referenced by branch_prob(), and gimple_gen_ic_func_profiler().
void gimple_remove_histogram_value | ( | struct function * | fun, |
gimple | stmt, | ||
histogram_value | hist | ||
) |
Remove histogram HIST from STMT's histogram list.
References histogram_value_t::counters, free(), gimple_histogram_value(), histogram_value_t::hvalue, memset(), histogram_value_t::next, and set_histogram_value().
Referenced by gimple_divmod_fixed_value_transform(), gimple_ic_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_remove_stmt_histograms(), gimple_stringops_transform(), ipa_profile_generate_summary(), and stringop_block_profile().
bool gimple_value_profile_transformations | ( | void | ) |
GIMPLE based transformations.
References cfun, changed, counts_to_freqs(), dump_file, dump_histograms_for_stmt(), gimple_bb(), gimple_divmod_fixed_value_transform(), gimple_histogram_value(), gimple_ic_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), gsi_end_p(), gsi_for_stmt(), gsi_next(), gsi_start_bb(), gsi_stmt(), and print_gimple_stmt().
Referenced by tree_profiling().
void init_branch_prob | ( | void | ) |
In profile.c.
Perform file-level initialization for branch-prob processing.
References total_hist_br_prob, total_num_blocks, total_num_blocks_created, total_num_branches, total_num_edges, total_num_edges_ignored, total_num_edges_instrumented, total_num_passes, and total_num_times_called.
void stream_in_histogram_value | ( | struct lto_input_block * | , |
gimple | |||
) |
void stream_out_histogram_value | ( | struct output_block * | , |
histogram_value | |||
) |
void stringop_block_profile | ( | gimple | , |
unsigned int * | , | ||
HOST_WIDE_INT * | |||
) |
References cfun, count, histogram_value_t::counters, gimple_histogram_value_of_type(), gimple_remove_histogram_value(), HIST_TYPE_AVERAGE, HIST_TYPE_IOR, histogram, and histogram_value_t::hvalue.
Referenced by expand_builtin_memcpy(), and expand_builtin_memset_args().
void verify_histograms | ( | void | ) |
Verify sanity of the histograms.
References cfun, debug_gimple_stmt(), dump_histogram_value(), error(), error_found, gimple_histogram_value(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), histogram_value_t::hvalue, internal_error(), histogram_value_t::next, pointer_set_create(), pointer_set_destroy(), pointer_set_insert(), histogram_value_t::stmt, and visit_hist().
Referenced by verify_gimple_in_cfg().