summaryrefslogtreecommitdiff
path: root/gcc/tree-pass.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-01 16:08:15 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-01 16:08:15 +0000
commit68e3904eea189b7f28c88a07596dcd76d7264439 (patch)
tree417705d74e26aac95b03885b54a88b3c22e0d807 /gcc/tree-pass.h
parent95a18f4ecb8cfe8a34b885704c4fd191579690eb (diff)
downloadgcc-68e3904eea189b7f28c88a07596dcd76d7264439.tar.gz
* tree-pass.h (opt_pass): Add IPA_PASS.
(varpool_node, cgraph_node): Forward declare. (ipa_opt_pass): Define. (pass_ipa_inline): Turn into ipa_opt_pass. (pass_apply_inline): Remove. * ipa-inline.c (pass_ipa_inline): Turn into ipa_opt_pass. (apply_inline): Turn into .... (inline_transform): ... this one. (inline_generate_summary): New function. (pass_apply_inline): Remove. * function.h (ipa_opt_pass): Forward declare structure; typedef; vector. (struct function): Add ipa_transforms_to_apply. * passes.c (register_one_dump_file): Work on IPA_PASS. (init_optimization_passes): Remove pass_inline_parameters and pass_apply_inline. (pass_init_dump_file, pass_fini_dump_file): Break out from .... (execute_one_pass) ... here; apply transforms when possible. (add_ipa_transform_pass, execute_ipa_summary_asses, execute_one_ipa_transform_pass): New. (execute_ipa_pass_list): Update for IPA_PASS type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-pass.h')
-rw-r--r--gcc/tree-pass.h40
1 files changed, 35 insertions, 5 deletions
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index f391c52c374..4d16ed697d4 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -96,7 +96,8 @@ struct opt_pass
enum opt_pass_type {
GIMPLE_PASS,
RTL_PASS,
- SIMPLE_IPA_PASS
+ SIMPLE_IPA_PASS,
+ IPA_PASS
} type;
/* Terse name of the pass used as a fragment of the dump file name. */
const char *name;
@@ -133,7 +134,7 @@ struct opt_pass
unsigned int todo_flags_finish;
};
-/* Description or GIMPLE pass. */
+/* Description of GIMPLE pass. */
struct gimple_opt_pass
{
struct opt_pass pass;
@@ -145,7 +146,36 @@ struct rtl_opt_pass
struct opt_pass pass;
};
-/* Description if simple IPA pass. Simple IPA passes have just one execute
+struct varpool_node;
+struct cgraph_node;
+
+/* Description of IPA pass with generate summary, write, execute, read and
+ transform stages. */
+struct ipa_opt_pass
+{
+ 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 *);
+
+ /* 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 *);
+
+ /* 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
hook. */
struct simple_ipa_opt_pass
{
@@ -353,9 +383,10 @@ extern struct gimple_opt_pass pass_build_cgraph_edges;
extern struct gimple_opt_pass pass_reset_cc_flags;
/* IPA Passes */
+extern struct ipa_opt_pass pass_ipa_inline;
+
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_inline;
extern struct simple_ipa_opt_pass pass_ipa_early_inline;
extern struct simple_ipa_opt_pass pass_ipa_reference;
extern struct simple_ipa_opt_pass pass_ipa_pure_const;
@@ -471,7 +502,6 @@ 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_inline_parameters;
-extern struct gimple_opt_pass pass_apply_inline;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;