GCC Middle and Back End API Reference
gcc::pass_manager Class Reference

#include <pass_manager.h>

Collaboration diagram for gcc::pass_manager:

Public Member Functions

void * operator new (size_t sz)
 pass_manager (context *ctxt)
void register_pass (struct register_pass_info *pass_info)
void register_one_dump_file (struct opt_pass *pass)
opt_passget_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_passget_pass_split_all_insns () const
opt_passget_pass_mode_switching () const
opt_passget_pass_peephole2 () const
opt_passget_pass_profile () const

Data Fields

opt_passall_passes
opt_passall_small_ipa_passes
opt_passall_lowering_passes
opt_passall_regular_ipa_passes
opt_passall_lto_gen_passes
opt_passall_late_ipa_passes
opt_pass ** passes_by_id
int passes_by_id_size
opt_pass ** pass_lists [PASS_LIST_NUM]

Private Member Functions

void set_pass_for_id (int id, opt_pass *pass)
int register_dump_files_1 (struct opt_pass *pass, int properties)
void register_dump_files (struct opt_pass *pass, int properties)

Private Attributes

contextm_ctxt

Constructor & Destructor Documentation

pass_manager::pass_manager ( context ctxt)

Member Function Documentation

void pass_manager::dump_passes ( ) const
void pass_manager::dump_profile_report ( ) const

Size/time units change across gimple and RTL.

Referenced by do_per_function_toporder().

void pass_manager::execute_early_local_passes ( )

Access to specific passes, so that the majority can be private.

Referenced by cgraph_process_new_functions().

unsigned int pass_manager::execute_pass_mode_switching ( )
void pass_manager::finish_optimization_passes ( )

Do whatever is necessary to finish printing the graphs.

Referenced by lang_dependent_init_target().

struct opt_pass * pass_manager::get_pass_for_id ( int  id) const
read

Return the pass with the static pass number ID.

opt_pass* gcc::pass_manager::get_pass_mode_switching ( ) const
inline
opt_pass* gcc::pass_manager::get_pass_peephole2 ( ) const
inline
opt_pass* gcc::pass_manager::get_pass_profile ( ) const
inline
opt_pass* gcc::pass_manager::get_pass_split_all_insns ( ) const
inline

Various passes are manually cloned by epiphany.

void * pass_manager::operator new ( size_t  sz)

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 copmilation 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

Ensure that all fields of the pass manager are zero-initialized.

void pass_manager::register_dump_files ( struct opt_pass pass,
int  properties 
)
private

Register the dump files for the pass_manager starting at PASS. PROPERTIES reflects the properties that are guaranteed to be available at the beginning of the pipeline.

int pass_manager::register_dump_files_1 ( struct opt_pass pass,
int  properties 
)
private

Recursive worker function for register_dump_files.

If we have a gate, combine the properties that we could have with and without the pass being examined.

void pass_manager::register_one_dump_file ( struct opt_pass pass)
 See below in next_pass_1.   
 The name is both used to identify the pass for the purposes of plugins,
 and to specify dump file name and option.
 The latter two might want something short which is not quite unique; for
 that reason, we may have a disambiguating prefix, followed by a space
 to mark the start of the following dump file name / option string.   
 For any passes that do not have an optgroup set, and which are not
 IPA passes setup above, set the optgroup to OPTGROUP_OTHER so that
 any dump messages are emitted properly under -fopt-info(-optall).   
void pass_manager::register_pass ( struct register_pass_info pass_info)
 The checks below could fail in buggy plugins.  Existing GCC
 passes should never fail these checks, so we mention plugin in
 the messages.   
 Try to insert the new pass to the pass lists.  We need to check
 all five lists as the reference pass could be in one (or all) of
 them.   
 OK, we have successfully inserted the new pass. We need to register
 the dump files for the newly added pass and its duplicates (if any).
 Because the registration of plugin/backend passes happens after the
 command-line options are parsed, the options that specify single
 pass dumping (e.g. -fdump-tree-PASSNAME) cannot be used for new
 passes. Therefore we currently can only enable dumping of
 new passes when the 'dump-all' flags (e.g. -fdump-tree-all)
 are specified. While doing so, we also delete the pass_list_node
 objects created during pass positioning.   
     Check if dump-all flag is specified.   
void pass_manager::set_pass_for_id ( int  id,
opt_pass pass 
)
private

Set the static pass number of pass PASS to ID and record that in the mapping from static pass number to pass.

References gcc::context::get_dumps(), m_ctxt, pass_data::name, OPTGROUP_NONE, and opt_pass::static_pass_number.


Field Documentation

opt_pass* gcc::pass_manager::all_late_ipa_passes
opt_pass* gcc::pass_manager::all_lowering_passes
opt_pass* gcc::pass_manager::all_lto_gen_passes
opt_pass* gcc::pass_manager::all_passes

The root of the compilation pass tree, once constructed.

opt_pass* gcc::pass_manager::all_regular_ipa_passes
opt_pass* gcc::pass_manager::all_small_ipa_passes
context* gcc::pass_manager::m_ctxt
private
opt_pass** gcc::pass_manager::pass_lists[PASS_LIST_NUM]
opt_pass** gcc::pass_manager::passes_by_id

A map from static pass id to optimization pass.

Referenced by dump_profile_report(), and input_overwrite_node().

int gcc::pass_manager::passes_by_id_size

Referenced by register_pass_name().


The documentation for this class was generated from the following files: