summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
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/ipa-inline.c
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/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c62
1 files changed, 29 insertions, 33 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f251fbebe30..f0a7819cacf 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"