/* Definitions for describing one tree-ssa optimization pass.
- Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>
This file is part of GCC.
#ifndef GCC_TREE_PASS_H
#define GCC_TREE_PASS_H 1
-/* In tree-dump.c */
+#include "timevar.h"
/* Different tree dump places. When you add new tree dump places,
extend the DUMP_FILES array in tree-dump.c. */
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
message. */
+#define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
+ dumper to print stmts. */
+#define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
+ a gimple stmt. */
+/* In tree-dump.c */
-extern char *get_dump_file_name (enum tree_dump_index);
-extern int dump_enabled_p (enum tree_dump_index);
-extern int dump_initialized_p (enum tree_dump_index);
-extern FILE *dump_begin (enum tree_dump_index, int *);
-extern void dump_end (enum tree_dump_index, FILE *);
+extern char *get_dump_file_name (int);
+extern int dump_enabled_p (int);
+extern int dump_initialized_p (int);
+extern FILE *dump_begin (int, int *);
+extern void dump_end (int, FILE *);
extern void dump_node (const_tree, int, FILE *);
extern int dump_switch_p (const char *);
-extern const char *dump_flag_name (enum tree_dump_index);
+extern const char *dump_flag_name (int);
/* Global variables used to communicate with passes. */
extern FILE *dump_file;
extern const char *dump_file_name;
/* Return the dump_file_info for the given phase. */
-extern struct dump_file_info *get_dump_file_info (enum tree_dump_index);
+extern struct dump_file_info *get_dump_file_info (int);
+
+/* Optimization pass type. */
+enum opt_pass_type
+{
+ GIMPLE_PASS,
+ RTL_PASS,
+ SIMPLE_IPA_PASS,
+ IPA_PASS
+};
/* Describe one pass; this is the common part shared across different pass
types. */
struct opt_pass
{
/* Optimization pass type. */
- enum opt_pass_type {
- GIMPLE_PASS,
- RTL_PASS,
- SIMPLE_IPA_PASS,
- IPA_PASS
- } type;
- /* Terse name of the pass used as a fragment of the dump file name. */
+ enum opt_pass_type type;
+
+ /* Terse name of the pass used as a fragment of the dump file
+ name. If the name starts with a star, no dump happens. */
const char *name;
/* If non-null, this pass and all sub-passes are executed only if
/* The timevar id associated with this pass. */
/* ??? Ideally would be dynamically assigned. */
- unsigned int tv_id;
+ timevar_id_t tv_id;
/* Sets of properties input and output from this pass. */
unsigned int properties_required;
struct opt_pass pass;
};
-/* Decription of RTL pass. */
+/* Description of RTL pass. */
struct rtl_opt_pass
{
struct opt_pass pass;
struct varpool_node;
struct cgraph_node;
+struct cgraph_node_set_def;
/* Description of IPA pass with generate summary, write, execute, read and
transform stages. */
-struct ipa_opt_pass
+struct ipa_opt_pass_d
{
struct opt_pass pass;
- /* IPA passes can analyze function body and variable initializers using this
- hook and produce summary. */
- void (*function_generate_summary) (struct cgraph_node *);
- void (*variable_generate_summary) (struct varpool_node *);
+ /* IPA passes can analyze function body and variable initializers
+ using this hook and produce summary. */
+ void (*generate_summary) (void);
- /* These hooks will be used to serialize IPA summaries on disk. For a moment
- they are just placeholders. */
- void (*function_write_summary) (struct cgraph_node *);
- void (*variable_write_summary) (struct varpool_node *);
- void (*function_read_summary) (struct cgraph_node *);
- void (*variable_read_summary) (struct varpool_node *);
+ /* This hook is used to serialize IPA summaries on disk. */
+ void (*write_summary) (struct cgraph_node_set_def *);
+ /* For most ipa passes, the information can only be deserialized in
+ one chunk. However, function bodies are read function at a time
+ as needed so both calls are necessary. */
+ void (*read_summary) (void);
+ void (*function_read_summary) (struct cgraph_node *);
+
/* Results of interprocedural propagation of an IPA pass is applied to
function body via this hook. */
unsigned int function_transform_todo_flags_start;
unsigned int (*function_transform) (struct cgraph_node *);
void (*variable_transform) (struct varpool_node *);
-
};
/* Description of simple IPA pass. Simple IPA passes have just one execute
#define PROP_ssa (1 << 5)
#define PROP_no_crit_edges (1 << 6)
#define PROP_rtl (1 << 7)
-#define PROP_alias (1 << 8)
-#define PROP_gimple_lomp (1 << 9) /* lowered OpenMP directives */
+#define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */
+#define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */
#define PROP_trees \
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
#define TODO_mark_first_instance (1 << 19)
/* Rebuild aliasing info. */
-#define TODO_rebuild_alias (1 << 20)
+#define TODO_rebuild_alias (1 << 20)
+
+/* Rebuild the addressable-vars bitmap and do register promotion. */
+#define TODO_update_address_taken (1 << 21)
#define TODO_update_ssa_any \
(TODO_update_ssa \
extern struct gimple_opt_pass pass_early_tree_profile;
extern struct gimple_opt_pass pass_cleanup_cfg;
extern struct gimple_opt_pass pass_referenced_vars;
+extern struct gimple_opt_pass pass_cleanup_eh;
+extern struct gimple_opt_pass pass_fixup_cfg;
extern struct gimple_opt_pass pass_sra;
extern struct gimple_opt_pass pass_sra_early;
extern struct gimple_opt_pass pass_tail_recursion;
extern struct gimple_opt_pass pass_scev_cprop;
extern struct gimple_opt_pass pass_empty_loop;
extern struct gimple_opt_pass pass_record_bounds;
+extern struct gimple_opt_pass pass_graphite_transforms;
extern struct gimple_opt_pass pass_if_conversion;
extern struct gimple_opt_pass pass_loop_distribution;
extern struct gimple_opt_pass pass_vectorize;
+extern struct gimple_opt_pass pass_slp_vectorize;
extern struct gimple_opt_pass pass_complete_unroll;
extern struct gimple_opt_pass pass_complete_unrolli;
extern struct gimple_opt_pass pass_parallelize_loops;
extern struct gimple_opt_pass pass_ccp;
extern struct gimple_opt_pass pass_phi_only_cprop;
extern struct gimple_opt_pass pass_build_ssa;
-extern struct gimple_opt_pass pass_del_ssa;
extern struct gimple_opt_pass pass_build_alias;
+extern struct gimple_opt_pass pass_build_ealias;
extern struct gimple_opt_pass pass_dominator;
extern struct gimple_opt_pass pass_dce;
extern struct gimple_opt_pass pass_dce_loop;
extern struct gimple_opt_pass pass_cd_dce;
+extern struct gimple_opt_pass pass_call_cdce;
extern struct gimple_opt_pass pass_merge_phi;
extern struct gimple_opt_pass pass_split_crit_edges;
extern struct gimple_opt_pass pass_pre;
extern struct gimple_opt_pass pass_profile;
+extern struct gimple_opt_pass pass_strip_predict_hints;
extern struct gimple_opt_pass pass_lower_complex_O0;
extern struct gimple_opt_pass pass_lower_complex;
extern struct gimple_opt_pass pass_lower_vector;
extern struct gimple_opt_pass pass_phiprop;
extern struct gimple_opt_pass pass_tree_ifcombine;
extern struct gimple_opt_pass pass_dse;
-extern struct gimple_opt_pass pass_simple_dse;
extern struct gimple_opt_pass pass_nrv;
-extern struct gimple_opt_pass pass_mark_used_blocks;
extern struct gimple_opt_pass pass_rename_ssa_copies;
extern struct gimple_opt_pass pass_rest_of_compilation;
extern struct gimple_opt_pass pass_sink_code;
extern struct gimple_opt_pass pass_linear_transform;
extern struct gimple_opt_pass pass_check_data_deps;
extern struct gimple_opt_pass pass_copy_prop;
-extern struct gimple_opt_pass pass_store_ccp;
extern struct gimple_opt_pass pass_vrp;
extern struct gimple_opt_pass pass_uncprop;
extern struct gimple_opt_pass pass_return_slot;
extern struct gimple_opt_pass pass_reassoc;
extern struct gimple_opt_pass pass_rebuild_cgraph_edges;
+extern struct gimple_opt_pass pass_remove_cgraph_callee_edges;
extern struct gimple_opt_pass pass_build_cgraph_edges;
-extern struct gimple_opt_pass pass_reset_cc_flags;
+extern struct gimple_opt_pass pass_local_pure_const;
+extern struct gimple_opt_pass pass_tracer;
/* IPA Passes */
-extern struct ipa_opt_pass pass_ipa_inline;
-extern struct simple_ipa_opt_pass pass_ipa_reference;
+extern struct ipa_opt_pass_d pass_ipa_inline;
+extern struct ipa_opt_pass_d pass_ipa_cp;
+extern struct ipa_opt_pass_d pass_ipa_reference;
+extern struct ipa_opt_pass_d pass_ipa_pure_const;
extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg;
-extern struct simple_ipa_opt_pass pass_ipa_cp;
extern struct simple_ipa_opt_pass pass_ipa_early_inline;
-extern struct simple_ipa_opt_pass pass_ipa_pure_const;
extern struct simple_ipa_opt_pass pass_ipa_type_escape;
extern struct simple_ipa_opt_pass pass_ipa_pta;
extern struct simple_ipa_opt_pass pass_ipa_struct_reorg;
extern struct gimple_opt_pass pass_all_optimizations;
extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing;
-extern struct gimple_opt_pass pass_free_cfg_annotations;
-extern struct gimple_opt_pass pass_free_datastructures;
extern struct gimple_opt_pass pass_init_datastructures;
extern struct gimple_opt_pass pass_fixup_cfg;
extern struct rtl_opt_pass pass_rtl_dse1;
extern struct rtl_opt_pass pass_rtl_dse2;
extern struct rtl_opt_pass pass_rtl_dse3;
-extern struct rtl_opt_pass pass_gcse;
-extern struct rtl_opt_pass pass_jump_bypass;
-extern struct rtl_opt_pass pass_profiling;
+extern struct rtl_opt_pass pass_rtl_cprop;
+extern struct rtl_opt_pass pass_rtl_pre;
+extern struct rtl_opt_pass pass_rtl_hoist;
+extern struct rtl_opt_pass pass_rtl_store_motion;
+extern struct rtl_opt_pass pass_cse_after_global_opts;
extern struct rtl_opt_pass pass_rtl_ifcvt;
-extern struct gimple_opt_pass pass_tracer;
extern struct rtl_opt_pass pass_into_cfg_layout_mode;
extern struct rtl_opt_pass pass_outof_cfg_layout_mode;
extern struct rtl_opt_pass pass_cse2;
extern struct rtl_opt_pass pass_df_initialize_opt;
extern struct rtl_opt_pass pass_df_initialize_no_opt;
-extern struct rtl_opt_pass pass_regclass_init;
+extern struct rtl_opt_pass pass_reginfo_init;
extern struct rtl_opt_pass pass_subregs_of_mode_init;
extern struct rtl_opt_pass pass_subregs_of_mode_finish;
extern struct rtl_opt_pass pass_inc_dec;
extern struct rtl_opt_pass pass_see;
extern struct rtl_opt_pass pass_sms;
extern struct rtl_opt_pass pass_sched;
-extern struct rtl_opt_pass pass_local_alloc;
-extern struct rtl_opt_pass pass_global_alloc;
+extern struct rtl_opt_pass pass_ira;
extern struct rtl_opt_pass pass_postreload;
extern struct rtl_opt_pass pass_clean_state;
extern struct rtl_opt_pass pass_branch_prob;
extern struct rtl_opt_pass pass_rtl_seqabstr;
extern struct gimple_opt_pass pass_release_ssa_names;
extern struct gimple_opt_pass pass_early_inline;
-extern struct gimple_opt_pass pass_O0_always_inline;
extern struct gimple_opt_pass pass_inline_parameters;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;
+extern struct gimple_opt_pass pass_convert_switch;
/* The root of the compilation pass tree, once constructed. */
extern struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
+/* Current optimization pass. */
+extern struct opt_pass *current_pass;
+
+extern struct opt_pass * get_pass_for_id (int);
extern void execute_pass_list (struct opt_pass *);
extern void execute_ipa_pass_list (struct opt_pass *);
extern void print_current_pass (FILE *);
extern void debug_pass (void);
+extern void register_one_dump_file (struct opt_pass *);
+extern bool function_called_by_processed_nodes_p (void);
/* Set to true if the pass is called the first time during compilation of the
current function. Note that using this information in the optimization