GCC Middle and Back End API Reference
ipa_opt_pass_d Class Reference

#include <tree-pass.h>

Inheritance diagram for ipa_opt_pass_d:
Collaboration diagram for ipa_opt_pass_d:

Public Member Functions

virtual opt_passclone ()
virtual bool gate ()
virtual unsigned int execute ()

Data Fields

void(* generate_summary )(void)
void(* write_summary )(void)
void(* read_summary )(void)
void(* write_optimization_summary )(void)
void(* read_optimization_summary )(void)
void(* stmt_fixup )(struct cgraph_node *, gimple *)
unsigned int function_transform_todo_flags_start
unsigned int(* function_transform )(struct cgraph_node *)
void(* variable_transform )(struct varpool_node *)
struct opt_passsub
struct opt_passnext
int static_pass_number
enum opt_pass_type type
const char * name
unsigned int optinfo_flags
bool has_gate
bool has_execute
timevar_id_t tv_id
unsigned int properties_required
unsigned int properties_provided
unsigned int properties_destroyed
unsigned int todo_flags_start
unsigned int todo_flags_finish

Protected Member Functions

 ipa_opt_pass_d (const pass_data &data, gcc::context *ctxt, void(*generate_summary)(void), void(*write_summary)(void), void(*read_summary)(void), void(*write_optimization_summary)(void), void(*read_optimization_summary)(void), void(*stmt_fixup)(struct cgraph_node *, gimple *), unsigned int function_transform_todo_flags_start, unsigned int(*function_transform)(struct cgraph_node *), void(*variable_transform)(struct varpool_node *))

Protected Attributes


Detailed Description

   Description of IPA pass with generate summary, write, execute, read and
   transform stages.  

Constructor & Destructor Documentation

ipa_opt_pass_d::ipa_opt_pass_d ( const pass_data data,
gcc::context ctxt,
void(*)(void)  generate_summary,
void(*)(void)  write_summary,
void(*)(void)  read_summary,
void(*)(void)  write_optimization_summary,
void(*)(void)  read_optimization_summary,
void(*)(struct cgraph_node *, gimple *)  stmt_fixup,
unsigned int  function_transform_todo_flags_start,
unsigned int(*)(struct cgraph_node *)  function_transform,
void(*)(struct varpool_node *)  variable_transform 

Member Function Documentation

opt_pass * opt_pass::clone ( )
     Create a copy of this pass.

     Passes that can have multiple instances must provide their own
     implementation of this, to ensure that any sharing of state between
     this instance and the copy is "wired up" correctly.

     The default implementation prints an error message and aborts.  
   Most passes are single-instance (within their context) and thus don't
   need to implement cloning, but passes that support multiple instances
   *must* provide their own implementation of the clone method.

   Handle this by providing a default implemenation, but make it a fatal
   error to call it.  

Referenced by add_pass_instance(), execute_fold_all_builtins(), and gate_copyrename().

unsigned int opt_pass::execute ( )
     This is the code to run.  If has_execute is false, then there should
     be sub-passes otherwise this pass does nothing.
     The return value contains TODOs to execute in addition to those in

Referenced by execute_fold_all_builtins(), gate_check_data_deps(), gate_copyrename(), gate_tree_loop_vectorize(), gate_tree_ssa_loop_ivopts(), make_pass_graphite(), mark_operand_necessary(), replace_profitable_candidates(), rewrite_blocks(), rtl_loop_done(), rtl_loop_init(), tree_ssa_loop_bounds(), and tree_ssa_loop_done().

bool opt_pass::gate ( )
     If has_gate is set, this pass and all sub-passes are executed only if
     the function returns true.
     The default implementation returns true.  

Referenced by gate_check_data_deps(), gate_copyrename(), gate_tree_loop_vectorize(), gate_tree_ssa_loop_ivopts(), make_pass_graphite(), mark_operand_necessary(), replace_profitable_candidates(), and rewrite_blocks().

Field Documentation

unsigned int(* ipa_opt_pass_d::function_transform)(struct cgraph_node *)

Referenced by verify_curr_properties().

unsigned int ipa_opt_pass_d::function_transform_todo_flags_start
     Results of interprocedural propagation of an IPA pass is applied to
     function body via this hook.  
void(* ipa_opt_pass_d::generate_summary)(void)
     IPA passes can analyze function body and variable initializers
      using this hook and produce summary.  

Referenced by gimple_opt_pass::gimple_opt_pass().

bool pass_data::has_execute
     If true, this pass has its own implementation of the opt_pass::execute
bool pass_data::has_gate
     If true, this pass has its own implementation of the opt_pass::gate
gcc::context* opt_pass::m_ctxt
const char* pass_data::name
     Terse name of the pass used as a fragment of the dump file
     name.  If the name starts with a star, no dump happens. 

Referenced by gcc::pass_manager::execute_pass_mode_switching(), is_pass_explicitly_enabled_or_disabled(), and gcc::pass_manager::set_pass_for_id().

struct opt_pass* opt_pass::next
     Next in the list of passes to run, independent of gate predicate.  

Referenced by add_pass_instance().

unsigned int pass_data::optinfo_flags
     The -fopt-info optimization group flags as defined in dumpfile.h. 
unsigned int pass_data::properties_destroyed
unsigned int pass_data::properties_provided
unsigned int pass_data::properties_required
     Sets of properties input and output from this pass.  
void(* ipa_opt_pass_d::read_optimization_summary)(void)
     This hook is used to deserialize IPA summaries from disk.  
void(* ipa_opt_pass_d::read_summary)(void)
     This hook is used to deserialize IPA summaries from disk.  

Referenced by ipa_write_summaries().

int opt_pass::static_pass_number
void(* ipa_opt_pass_d::stmt_fixup)(struct cgraph_node *, gimple *)
     Hook to convert gimple stmt uids into true gimple statements.  The second
     parameter is an array of statements indexed by their uid. 
struct opt_pass* opt_pass::sub
     A list of sub-passes to run, dependent on gate predicate.  

Referenced by ipa_write_summaries().

unsigned int pass_data::todo_flags_finish
unsigned int pass_data::todo_flags_start
     Flags indicating common sets things to do before and after.  

Referenced by is_pass_explicitly_enabled_or_disabled().

timevar_id_t pass_data::tv_id
     The timevar id associated with this pass.  
     ??? Ideally would be dynamically assigned.  

Referenced by ipa_write_summaries().

enum opt_pass_type pass_data::type
     Optimization pass type.  

Referenced by add_pass_instance(), and ipa_write_summaries().

void(* ipa_opt_pass_d::variable_transform)(struct varpool_node *)
void(* ipa_opt_pass_d::write_optimization_summary)(void)
     This hook is used to serialize IPA optimization summaries on disk.  
void(* ipa_opt_pass_d::write_summary)(void)
     This hook is used to serialize IPA summaries on disk.  

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