GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "function.h"
#include "tree-pass.h"
#include "context.h"
#include "pass_manager.h"
#include "tree.h"
Data Structures | |
struct | statistics_counter |
struct | stats_counter_hasher |
Typedefs | |
typedef hash_table< stats_counter_hasher > | stats_counter_table_type |
Functions | |
static stats_counter_table_type * | curr_statistics_hash (bool alloc=true) |
static const char * | get_function_name (struct function *fn) |
int | statistics_fini_pass_1 (statistics_counter **slot, void *data) |
int | statistics_fini_pass_2 (statistics_counter **slot, void *data) |
int | statistics_fini_pass_3 (statistics_counter **slot, void *data) |
void | statistics_fini_pass (void) |
int | statistics_fini_1 (statistics_counter **slot, opt_pass *pass) |
void | statistics_fini (void) |
void | statistics_early_init (void) |
void | statistics_init (void) |
static statistics_counter * | lookup_or_add_counter (stats_counter_table_type *hash, const char *id, int val, bool histogram_p) |
void | statistics_counter_event (struct function *fn, const char *id, int incr) |
void | statistics_histogram_event (struct function *fn, const char *id, int val) |
Variables | |
static int | statistics_dump_nr |
static dump_flags_t | statistics_dump_flags |
static FILE * | statistics_dump_file |
static stats_counter_table_type ** | statistics_hashes |
static unsigned | nr_statistics_hashes |
|
static |
Return the current hashtable to be used for recording or printing statistics.
References current_pass, gcc_assert, nr_statistics_hashes, and statistics_hashes.
Referenced by statistics_counter_event(), statistics_fini_pass(), and statistics_histogram_event().
|
static |
Helper function to return asmname or name of FN depending on whether asmname option is set.
References function::decl, decl_assembler_name(), DECL_ASSEMBLER_NAME_SET_P, function_name(), IDENTIFIER_POINTER, statistics_dump_flags, and TDF_ASMNAME.
Referenced by statistics_counter_event(), statistics_fini_pass_2(), and statistics_histogram_event().
|
static |
Lookup or add a statistics counter in the hashtable HASH with ID, VAL and HISTOGRAM_P.
References hash_table< Descriptor, Lazy, Allocator >::find_slot(), statistics_counter::id, and statistics_counter::val.
Referenced by statistics_counter_event(), and statistics_histogram_event().
void statistics_counter_event | ( | struct function * | fn, |
const char * | id, | ||
int | incr ) |
Add statistics information about event ID in function FN. This will increment the counter associated with ID by INCR. It will also dump the event to the global statistics file if requested.
References statistics_counter::count, curr_statistics_hash(), current_pass, dump_flags, gcc_assert, get_function_name(), statistics_counter::histogram_p, lookup_or_add_counter(), statistics_dump_file, statistics_dump_flags, TDF_DETAILS, and TDF_STATS.
Referenced by analyze_all_variable_accesses(), combine_instructions(), cond_if_else_store_replacement_1(), cond_store_replacement(), do_rpo_vn_1(), eliminate_dom_walker::eliminate_cleanup(), factor_out_conditional_operation(), fini_reassoc(), gcse_after_reload_main(), hoist_adjacent_loads(), match_simplify_replacement(), perform_intra_sra(), perform_tree_ssa_dce(), release_free_names_and_compact_live_names(), remove_unused_locals(), replace_phi_edge_with_variable(), simple_dce_from_worklist(), spaceship_replacement(), substitute_and_fold_engine::substitute_and_fold(), jt_path_registry::thread_through_all_blocks(), update_ssa(), value_replacement(), and vt_find_locations().
void statistics_early_init | ( | void | ) |
Register the statistics dump file.
References DK_tree, gcc::dump_manager::dump_register(), g, OPTGROUP_NONE, and statistics_dump_nr.
Referenced by general_init().
void statistics_fini | ( | void | ) |
Finish the statistics and dump summary information.
References dump_end(), g, gcc::pass_manager::get_pass_for_id(), i, nr_statistics_hashes, NULL, statistics_dump_file, statistics_dump_flags, statistics_dump_nr, statistics_fini_1(), statistics_hashes, and TDF_STATS.
Referenced by finalize().
int statistics_fini_1 | ( | statistics_counter ** | slot, |
opt_pass * | pass ) |
Helper for printing summary information.
References statistics_counter::count, statistics_counter::histogram_p, HOST_WIDE_INT_PRINT_DEC, statistics_counter::id, pass_data::name, opt_pass::static_pass_number, statistics_dump_file, and statistics_counter::val.
Referenced by statistics_fini().
void statistics_fini_pass | ( | void | ) |
Dump the current statistics incrementally.
References curr_statistics_hash(), current_pass, dump_file, dump_flags, NULL, statistics_dump_file, statistics_dump_flags, statistics_fini_pass_1(), statistics_fini_pass_2(), statistics_fini_pass_3(), TDF_DETAILS, TDF_STATS, and hash_table< Descriptor, Lazy, Allocator >::traverse_noresize().
Referenced by execute_todo().
int statistics_fini_pass_1 | ( | statistics_counter ** | slot, |
void * | data ) |
Helper for statistics_fini_pass. Print the counter difference since the last dump for the pass dump files.
References count, statistics_counter::count, dump_file, statistics_counter::histogram_p, HOST_WIDE_INT_PRINT_DEC, statistics_counter::id, statistics_counter::prev_dumped_count, and statistics_counter::val.
Referenced by statistics_fini_pass().
int statistics_fini_pass_2 | ( | statistics_counter ** | slot, |
void * | data ) |
Helper for statistics_fini_pass. Print the counter difference since the last dump for the statistics dump.
References cfun, count, statistics_counter::count, current_pass, get_function_name(), statistics_counter::histogram_p, HOST_WIDE_INT_PRINT_DEC, statistics_counter::id, statistics_counter::prev_dumped_count, statistics_dump_file, and statistics_counter::val.
Referenced by statistics_fini_pass().
int statistics_fini_pass_3 | ( | statistics_counter ** | slot, |
void * | data ) |
Helper for statistics_fini_pass, reset the counters.
References statistics_counter::count, and statistics_counter::prev_dumped_count.
Referenced by statistics_fini_pass().
void statistics_histogram_event | ( | struct function * | fn, |
const char * | id, | ||
int | val ) |
Add statistics information about event ID in function FN with the histogram value VAL. It will dump the event to the global statistics file if requested.
References statistics_counter::count, curr_statistics_hash(), current_pass, dump_flags, gcc_assert, get_function_name(), statistics_counter::histogram_p, lookup_or_add_counter(), statistics_dump_file, statistics_dump_flags, TDF_DETAILS, and TDF_STATS.
Referenced by compute_antic(), do_rpo_vn_1(), and insert().
void statistics_init | ( | void | ) |
Init the statistics.
References dump_begin(), g, gcc::dump_manager::get_dump_file_info(), NULL, dump_file_info::pflags, statistics_dump_file, statistics_dump_flags, and statistics_dump_nr.
Referenced by do_compile().
|
static |
Referenced by curr_statistics_hash(), and statistics_fini().
|
static |
|
static |
|
static |
Optimization statistics functions. Copyright (C) 2008-2025 Free Software Foundation, Inc. Contributed by Richard Guenther <rguenther@suse.de> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Referenced by statistics_early_init(), statistics_fini(), and statistics_init().
|
static |
Array of statistic hashes, indexed by pass id.
Referenced by curr_statistics_hash(), and statistics_fini().