This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto][patch] Split all_ipa_pass
- From: "Rafael Espindola" <espindola at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "Diego Novillo" <dnovillo at google dot com>
- Date: Tue, 21 Oct 2008 03:11:24 +0100
- Subject: [lto][patch] Split all_ipa_pass
This is the first patch in a series to get the inliner running on cc1.
This patch splits all_ipa_pass. With the patch, it contains only the
small ipa passes. All the regular ipa passes are moved to
all_regular_ipa_pass. This is necessary in order to be able to execute
the regular ipa in cc1 and then generate summary again to write to
disk.
OK for LTO?
2008-10-21 Rafael Espindola <espindola@google.com>
* cgraphunit.c (ipa_passes): call execute_ipa_pass_list on
all_regular_ipa_passes.
* passes.c (all_regular_ipa_passes): New.
(init_optimization_passes): Init all_regular_ipa_passes.
(ipa_write_summaries,ipa_read_summaries,
ipa_write_summaries_of_cgraph_node_set): Use all_regular_ipa_passes.
* tree-pass.h (all_regular_ipa_passes): New.
Cheers,
--
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 3f90730..ce10799 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1248,6 +1248,7 @@ ipa_passes (void)
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
execute_ipa_pass_list (all_ipa_passes);
+ execute_ipa_pass_list (all_regular_ipa_passes);
bitmap_obstack_release (NULL);
}
diff --git a/gcc/passes.c b/gcc/passes.c
index a39c7ab..2768c93 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -333,7 +333,8 @@ struct rtl_opt_pass pass_postreload =
/* The root of the compilation pass tree, once constructed. */
-struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
+struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes,
+ *all_regular_ipa_passes;
/* A map from static pass id to optimization pass. */
struct opt_pass **passes_by_id;
@@ -572,8 +573,10 @@ init_optimization_passes (void)
}
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_matrix_reorg);
+ *p = NULL;
+
+ p = &all_regular_ipa_passes;
NEXT_PASS (pass_ipa_cp);
- /* All regular IPA_PASSes need to be clumped together. */
NEXT_PASS (pass_ipa_lto_gimple_out);
NEXT_PASS (pass_ipa_lto_cgraph);
NEXT_PASS (pass_ipa_inline);
@@ -584,7 +587,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_ipa_struct_reorg);
NEXT_PASS (pass_ipa_lto_wpa_fixup);
NEXT_PASS (pass_ipa_lto_finish_out); /* This must be the last IPA_PASS. */
-
*p = NULL;
/* These passes are run after IPA passes on every function that is being
@@ -834,6 +836,9 @@ init_optimization_passes (void)
register_dump_files (all_ipa_passes,
PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
| PROP_cfg);
+ register_dump_files (all_regular_ipa_passes,
+ PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
+ | PROP_cfg);
register_dump_files (all_passes,
PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
| PROP_cfg);
@@ -1390,7 +1395,7 @@ ipa_write_summaries (void)
set = cgraph_node_set_new ();
for (node = cgraph_nodes; node; node = node->next)
cgraph_node_set_add (set, node);
- ipa_write_summaries_1 (all_ipa_passes, set);
+ ipa_write_summaries_1 (all_regular_ipa_passes, set);
lto_delete_static_inline_states ();
ggc_free (set);
}
@@ -1400,7 +1405,7 @@ void
ipa_write_summaries_of_cgraph_node_set (cgraph_node_set set)
{
if (flag_generate_lto && !(errorcount || sorrycount))
- ipa_write_summaries_1 (all_ipa_passes, set);
+ ipa_write_summaries_1 (all_regular_ipa_passes, set);
}
/* Same as execute_pass_list but assume that subpasses of IPA passes
@@ -1430,7 +1435,7 @@ ipa_read_summaries_1 (struct opt_pass *pass)
void
ipa_read_summaries (void)
{
- ipa_read_summaries_1 (all_ipa_passes);
+ ipa_read_summaries_1 (all_regular_ipa_passes);
}
/* Same as execute_pass_list but assume that subpasses of IPA passes
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index b574b65..fbc3d6b 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -522,7 +522,8 @@ 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;
+extern struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes,
+ *all_regular_ipa_passes;
/* Current optimization pass. */
extern struct opt_pass *current_pass;