From d3fcfa095d209550c814e878b744f7d9b2394729 Mon Sep 17 00:00:00 2001 From: Giuliano Belinassi Date: Sun, 12 May 2019 13:07:57 -0300 Subject: Split rtl_passes from all_passes Signed-off-by: Giuliano Belinassi --- gcc/cgraphunit.c | 2 ++ gcc/pass_manager.h | 2 ++ gcc/passes.c | 10 +++++++--- gcc/passes.def | 5 +++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8bfbd0bb12f..2c730dfba12 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2196,6 +2196,8 @@ cgraph_node::expand (void) invoke_plugin_callbacks (PLUGIN_ALL_PASSES_START, NULL); execute_pass_list (cfun, g->get_passes ()->all_passes); + if (!(rtl_dump_and_exit || flag_syntax_only || seen_error ())) + execute_pass_list (cfun, g->get_passes ()->all_rtl_passes); /* Signal the end of passes. */ invoke_plugin_callbacks (PLUGIN_ALL_PASSES_END, NULL); diff --git a/gcc/pass_manager.h b/gcc/pass_manager.h index 8c7d272f20f..473fc6a9df5 100644 --- a/gcc/pass_manager.h +++ b/gcc/pass_manager.h @@ -30,6 +30,7 @@ struct register_pass_info; DEF_PASS_LIST (all_small_ipa_passes) \ DEF_PASS_LIST (all_regular_ipa_passes) \ DEF_PASS_LIST (all_late_ipa_passes) \ + DEF_PASS_LIST (all_rtl_passes) \ DEF_PASS_LIST (all_passes) #define DEF_PASS_LIST(LIST) PASS_LIST_NO_##LIST, @@ -92,6 +93,7 @@ public: opt_pass *all_lowering_passes; opt_pass *all_regular_ipa_passes; opt_pass *all_late_ipa_passes; + opt_pass *all_rtl_passes; /* A map from static pass id to optimization pass. */ opt_pass **passes_by_id; diff --git a/gcc/passes.c b/gcc/passes.c index a9c22889d71..b76065470a8 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -958,6 +958,7 @@ pass_manager::dump_passes () const dump_pass_list (all_regular_ipa_passes, 1); dump_pass_list (all_late_ipa_passes, 1); dump_pass_list (all_passes, 1); + dump_pass_list (all_rtl_passes, 1); pop_dummy_function (); } @@ -1468,6 +1469,8 @@ pass_manager::register_pass (struct register_pass_info *pass_info) success |= position_pass (pass_info, &all_late_ipa_passes); if (!success || all_instances) success |= position_pass (pass_info, &all_passes); + if (!success || all_instances) + success |= position_pass (pass_info, &all_rtl_passes); if (!success) fatal_error (input_location, @@ -1515,9 +1518,9 @@ pass_manager::register_pass (struct register_pass_info *pass_info) */ pass_manager::pass_manager (context *ctxt) -: all_passes (NULL), all_small_ipa_passes (NULL), all_lowering_passes (NULL), - all_regular_ipa_passes (NULL), - all_late_ipa_passes (NULL), passes_by_id (NULL), passes_by_id_size (0), +: all_passes (NULL), all_rtl_passes (NULL), all_small_ipa_passes (NULL), all_lowering_passes (NULL), + all_regular_ipa_passes (NULL), all_late_ipa_passes (NULL), + passes_by_id (NULL), passes_by_id_size (0), m_ctxt (ctxt), m_name_to_pass_map (NULL) { opt_pass **p; @@ -1595,6 +1598,7 @@ pass_manager::pass_manager (context *ctxt) register_dump_files (all_regular_ipa_passes); register_dump_files (all_late_ipa_passes); register_dump_files (all_passes); + register_dump_files (all_rtl_passes); } static void diff --git a/gcc/passes.def b/gcc/passes.def index ad2efabd385..246775c1bed 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -395,9 +395,10 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_cleanup_cfg_post_optimizing); NEXT_PASS (pass_warn_function_noreturn); NEXT_PASS (pass_gen_hsail); + TERMINATE_PASS_LIST (all_passes) + INSERT_PASSES_AFTER (all_rtl_passes) NEXT_PASS (pass_expand); - NEXT_PASS (pass_rest_of_compilation); PUSH_INSERT_PASSES_WITHIN (pass_rest_of_compilation) NEXT_PASS (pass_instantiate_virtual_regs); @@ -499,4 +500,4 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_df_finish); POP_INSERT_PASSES () NEXT_PASS (pass_clean_state); - TERMINATE_PASS_LIST (all_passes) + TERMINATE_PASS_LIST (all_rtl_passes) -- 2.20.1