diff options
author | Jan Hubicka <jh@suse.cz> | 2008-05-01 18:08:15 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2008-05-01 16:08:15 +0000 |
commit | 17653c00b9d77f94272588e58400de197005b3a6 (patch) | |
tree | 417705d74e26aac95b03885b54a88b3c22e0d807 /gcc/ipa-inline.c | |
parent | bd9513ea36c626d301024efb0d0eebd43ca2489a (diff) | |
download | gcc-17653c00b9d77f94272588e58400de197005b3a6.zip gcc-17653c00b9d77f94272588e58400de197005b3a6.tar.gz gcc-17653c00b9d77f94272588e58400de197005b3a6.tar.bz2 |
tree-pass.h (opt_pass): Add IPA_PASS.
* 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.
From-SVN: r134859
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index f251fbe..f0a7819 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1426,26 +1426,6 @@ cgraph_gate_inlining (void) return flag_inline_trees; } -struct simple_ipa_opt_pass pass_ipa_inline = -{ - { - SIMPLE_IPA_PASS, - "inline", /* name */ - cgraph_gate_inlining, /* gate */ - cgraph_decide_inlining, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_INLINE_HEURISTICS, /* tv_id */ - 0, /* properties_required */ - PROP_cfg, /* properties_provided */ - 0, /* properties_destroyed */ - TODO_remove_functions, /* todo_flags_finish */ - TODO_dump_cgraph | TODO_dump_func - | TODO_remove_functions /* todo_flags_finish */ - } -}; - /* Because inlining might remove no-longer reachable nodes, we need to keep the array visible to garbage collector to avoid reading collected out nodes. */ @@ -1579,13 +1559,20 @@ struct gimple_opt_pass pass_inline_parameters = } }; -/* Apply inline plan to the function. */ -static unsigned int -apply_inline (void) +/* Note function body size. */ +void +inline_generate_summary (struct cgraph_node *node ATTRIBUTE_UNUSED) +{ + compute_inline_parameters (); + return; +} + +/* Apply inline plan to function. */ +int +inline_transform (struct cgraph_node *node) { unsigned int todo = 0; struct cgraph_edge *e; - struct cgraph_node *node = cgraph_node (current_function_decl); /* Even when not optimizing, ensure that always_inline functions get inlined. */ @@ -1617,13 +1604,13 @@ apply_inline (void) return todo | execute_fixup_cfg (); } -struct gimple_opt_pass pass_apply_inline = +struct ipa_opt_pass pass_ipa_inline = { { - GIMPLE_PASS, - "apply_inline", /* name */ - NULL, /* gate */ - apply_inline, /* execute */ + IPA_PASS, + "inline", /* name */ + cgraph_gate_inlining, /* gate */ + cgraph_decide_inlining, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ @@ -1631,10 +1618,19 @@ struct gimple_opt_pass pass_apply_inline = 0, /* properties_required */ PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_flow - | TODO_verify_stmts /* todo_flags_finish */ - } + TODO_remove_functions, /* todo_flags_finish */ + TODO_dump_cgraph | TODO_dump_func + | TODO_remove_functions /* todo_flags_finish */ + }, + inline_generate_summary, /* function_generate_summary */ + NULL, /* variable_generate_summary */ + NULL, /* function_write_summary */ + NULL, /* variable_write_summary */ + NULL, /* function_read_summary */ + NULL, /* variable_read_summary */ + 0, /* TODOs */ + inline_transform, /* function_transform */ + NULL, /* variable_transform */ }; #include "gt-ipa-inline.h" |