GCC Middle and Back End API Reference
|
#include <pass_manager.h>
Public Member Functions | |
pass_manager (context *ctxt) | |
~pass_manager () | |
void | register_pass (struct register_pass_info *pass_info) |
void | register_one_dump_file (opt_pass *pass) |
opt_pass * | get_pass_for_id (int id) const |
void | dump_passes () const |
void | dump_profile_report () const |
void | finish_optimization_passes () |
void | execute_early_local_passes () |
unsigned int | execute_pass_mode_switching () |
opt_pass * | get_pass_split_all_insns () const |
opt_pass * | get_pass_mode_switching () const |
opt_pass * | get_pass_peephole2 () const |
opt_pass * | get_pass_profile () const |
void | register_pass_name (opt_pass *pass, const char *name) |
opt_pass * | get_pass_by_name (const char *name) |
opt_pass * | get_rest_of_compilation () const |
opt_pass * | get_clean_slate () const |
Private Member Functions | |
void | set_pass_for_id (int id, opt_pass *pass) |
void | register_dump_files (opt_pass *pass) |
void | create_pass_tab () const |
Private Attributes | |
context * | m_ctxt |
hash_map< free_string_hash, opt_pass * > * | m_name_to_pass_map |
pass_manager::pass_manager | ( | context * | ctxt | ) |
Construct the pass tree. The sequencing of passes is driven by the cgraph routines: finalize_compilation_unit () for each node N in the cgraph cgraph_analyze_function (N) cgraph_lower_function (N) -> all_lowering_passes If we are optimizing, compile is then invoked: compile () ipa_passes () -> all_small_ipa_passes -> Analysis of all_regular_ipa_passes * possible LTO streaming at compilation time * -> Execution of all_regular_ipa_passes * possible LTO streaming at link time * -> all_late_ipa_passes expand_all_functions () for each node N in the cgraph expand_function (N) -> Transformation of all_regular_ipa_passes -> all_passes
References all_late_ipa_passes, all_lowering_passes, all_passes, all_regular_ipa_passes, all_small_ipa_passes, GCC_PASS_LISTS, m_ctxt, m_name_to_pass_map, NULL, passes_by_id, passes_by_id_size, and register_dump_files().
pass_manager::~pass_manager | ( | ) |
References GCC_PASS_LISTS, m_name_to_pass_map, and passes_by_id.
|
private |
The function traverses NAME_TO_PASS_MAP and creates a pass info table for dumping purpose.
References m_name_to_pass_map, NULL, pass_tab, passes_by_id_size, and passes_pass_traverse().
Referenced by dump_passes().
void pass_manager::dump_passes | ( | ) | const |
void pass_manager::dump_profile_report | ( | ) | const |
References dump_begin(), dump_end(), dump_file, profile_record::dyn_mismatched_count_in, profile_record::dyn_mismatched_prob_out, gcc::dump_manager::get_dump_file_info(), GIMPLE_PASS, i, m_ctxt, NULL, dump_file_info::num, profile_record::num_mismatched_count_in, profile_record::num_mismatched_prob_out, passes_by_id, passes_by_id_size, RTL_PASS, profile_record::size, TDI_profile_report, and profile_record::time.
void pass_manager::execute_early_local_passes | ( | ) |
References cfun, and execute_pass_list().
Referenced by cgraph_node::add_new_function().
unsigned int pass_manager::execute_pass_mode_switching | ( | ) |
References cfun.
void pass_manager::finish_optimization_passes | ( | void | ) |
References gcc::dump_manager::dump_finish(), gcc::dump_manager::dump_start(), end_branch_prob(), finish_graph_dump_file(), free(), gcc::dump_manager::get_dump_file_info(), gcc::dump_manager::get_dump_file_name(), dump_file_info::graph_dump_initialized, i, m_ctxt, NULL, TDI_end, timevar_pop(), and timevar_push().
|
inline |
opt_pass * pass_manager::get_pass_by_name | ( | const char * | name | ) |
Returns the pass with NAME.
References m_name_to_pass_map, and NULL.
opt_pass * pass_manager::get_pass_for_id | ( | int | id | ) | const |
Return the pass with the static pass number ID.
References NULL, passes_by_id, and passes_by_id_size.
Referenced by execute_all_ipa_transforms(), and statistics_fini().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Register the dump files for the pass_manager starting at PASS.
References pass_data::name, opt_pass::next, register_dump_files(), register_one_dump_file(), and opt_pass::sub.
Referenced by pass_manager(), and register_dump_files().
void pass_manager::register_one_dump_file | ( | opt_pass * | pass | ) |
References CONST_CAST, DK_ipa, DK_rtl, DK_tree, gcc::dump_manager::dump_register(), free(), GIMPLE_PASS, IPA_PASS, m_ctxt, pass_data::name, NULL, OPTGROUP_IPA, OPTGROUP_NONE, OPTGROUP_OTHER, pass_data::optinfo_flags, register_pass_name(), set_pass_for_id(), SIMPLE_IPA_PASS, opt_pass::static_pass_number, and pass_data::type.
Referenced by register_dump_files().
void pass_manager::register_pass | ( | struct register_pass_info * | pass_info | ) |
References added_pass_nodes, all_late_ipa_passes, all_lowering_passes, all_passes, all_regular_ipa_passes, all_small_ipa_passes, fatal_error(), input_location, m_ctxt, pass_data::name, register_pass_info::pass, position_pass(), register_pass_info::ref_pass_instance_number, register_pass_info::reference_pass_name, and gcc::dump_manager::register_pass().
void pass_manager::register_pass_name | ( | opt_pass * | pass, |
const char * | name ) |
|
private |
Set the static pass number of pass PASS to ID and record that in the mapping from static pass number to pass.
References passes_by_id, passes_by_id_size, and opt_pass::static_pass_number.
Referenced by register_one_dump_file().
opt_pass* gcc::pass_manager::all_late_ipa_passes |
Referenced by dump_passes(), pass_manager(), and register_pass().
opt_pass* gcc::pass_manager::all_lowering_passes |
Referenced by cgraph_node::add_new_function(), dump_passes(), pass_manager(), and register_pass().
opt_pass* gcc::pass_manager::all_passes |
Referenced by dump_passes(), pass_manager(), and register_pass().
opt_pass* gcc::pass_manager::all_regular_ipa_passes |
opt_pass* gcc::pass_manager::all_small_ipa_passes |
Referenced by dump_passes(), ipa_passes(), pass_manager(), and register_pass().
|
private |
Referenced by dump_profile_report(), finish_optimization_passes(), pass_manager(), register_one_dump_file(), and register_pass().
|
private |
Referenced by create_pass_tab(), get_pass_by_name(), pass_manager(), register_pass_name(), and ~pass_manager().
opt_pass** gcc::pass_manager::pass_lists[PASS_LIST_NUM] |
opt_pass** gcc::pass_manager::passes_by_id |
Referenced by dump_profile_report(), get_pass_for_id(), input_node(), pass_manager(), set_pass_for_id(), and ~pass_manager().
int gcc::pass_manager::passes_by_id_size |