From: Bernd Schmidt Date: Wed, 5 Nov 2014 12:14:45 +0000 (+0000) Subject: Reorganize post-ra pipeline for targets without register allocation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=433e4164339f18d0b8798968444a56b681b5232c;p=gcc.git Reorganize post-ra pipeline for targets without register allocation. * passes.def (pass_compute_alignments, pass_duplicate_computed_gotos, pass_variable_tracking, pass_free_cfg, pass_machine_reorg, pass_cleanup_barriers, pass_delay_slots, pass_split_for_shorten_branches, pass_convert_to_eh_region_ranges, pass_shorten_branches, pass_est_nothrow_function_flags, pass_dwarf2_frame, pass_final): Move outside of pass_postreload and into pass_late_compilation. (pass_late_compilation): Add. * passes.c (pass_data_late_compilation, pass_late_compilation, make_pass_late_compilation): New. * timevar.def (TV_LATE_COMPILATION): New. From-SVN: r217124 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74e0b0fd436..922283e5ceb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2014-11-05 Bernd Schmidt + * passes.def (pass_compute_alignments, pass_duplicate_computed_gotos, + pass_variable_tracking, pass_free_cfg, pass_machine_reorg, + pass_cleanup_barriers, pass_delay_slots, + pass_split_for_shorten_branches, pass_convert_to_eh_region_ranges, + pass_shorten_branches, pass_est_nothrow_function_flags, + pass_dwarf2_frame, pass_final): Move outside of pass_postreload and + into pass_late_compilation. + (pass_late_compilation): Add. + * passes.c (pass_data_late_compilation, pass_late_compilation, + make_pass_late_compilation): New. + * timevar.def (TV_LATE_COMPILATION): New. + * target.def (omit_struct_return_reg): New data hook. * doc/tm.texi.in: Add @hook TARGET_OMIT_STRUCT_RETURN_REG. * doc/tm.texi: Regenerate. diff --git a/gcc/passes.c b/gcc/passes.c index f9d15b89205..9ec0ebfc629 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -576,6 +576,44 @@ make_pass_postreload (gcc::context *ctxt) return new pass_postreload (ctxt); } +namespace { + +const pass_data pass_data_late_compilation = +{ + RTL_PASS, /* type */ + "*all-late_compilation", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + TV_LATE_COMPILATION, /* tv_id */ + PROP_rtl, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ +}; + +class pass_late_compilation : public rtl_opt_pass +{ +public: + pass_late_compilation (gcc::context *ctxt) + : rtl_opt_pass (pass_data_late_compilation, ctxt) + {} + + /* opt_pass methods: */ + virtual bool gate (function *) + { + return reload_completed || targetm.no_register_allocation; + } + +}; // class pass_late_compilation + +} // anon namespace + +static rtl_opt_pass * +make_pass_late_compilation (gcc::context *ctxt) +{ + return new pass_late_compilation (ctxt); +} + /* Set the static pass number of pass PASS to ID and record that diff --git a/gcc/passes.def b/gcc/passes.def index 9c2542d5352..6f6a4931bc5 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -417,6 +417,9 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_split_before_regstack); NEXT_PASS (pass_stack_regs_run); POP_INSERT_PASSES () + POP_INSERT_PASSES () + NEXT_PASS (pass_late_compilation); + PUSH_INSERT_PASSES_WITHIN (pass_late_compilation) NEXT_PASS (pass_compute_alignments); NEXT_PASS (pass_variable_tracking); NEXT_PASS (pass_free_cfg); diff --git a/gcc/timevar.def b/gcc/timevar.def index 96b606951d6..b74cbb0bca7 100644 --- a/gcc/timevar.def +++ b/gcc/timevar.def @@ -272,6 +272,7 @@ DEFTIMEVAR (TV_EARLY_LOCAL , "early local passes") DEFTIMEVAR (TV_OPTIMIZE , "unaccounted optimizations") DEFTIMEVAR (TV_REST_OF_COMPILATION , "rest of compilation") DEFTIMEVAR (TV_POSTRELOAD , "unaccounted post reload") +DEFTIMEVAR (TV_LATE_COMPILATION , "unaccounted late compilation") DEFTIMEVAR (TV_REMOVE_UNUSED , "remove unused locals") DEFTIMEVAR (TV_ADDRESS_TAKEN , "address taken") DEFTIMEVAR (TV_TODO , "unaccounted todo")