Reorganize post-ra pipeline for targets without register allocation.
authorBernd Schmidt <bernds@codesourcery.com>
Wed, 5 Nov 2014 12:14:45 +0000 (12:14 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Wed, 5 Nov 2014 12:14:45 +0000 (12:14 +0000)
* 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

gcc/ChangeLog
gcc/passes.c
gcc/passes.def
gcc/timevar.def

index 74e0b0fd43615912a0653e014b14c2f899aeb11e..922283e5cebd92a0c4fefafd1b5ead027dba3ffa 100644 (file)
@@ -1,5 +1,17 @@
 2014-11-05  Bernd Schmidt  <bernds@codesourcery.com>
 
+       * 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.
index f9d15b89205d914b8bd22b9f446a061267195494..9ec0ebfc629a27070de10880c882dc3999180a2e 100644 (file)
@@ -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
index 9c2542d5352201ad795b38a4c28173c31f37bb99..6f6a4931bc5866efaf00e75da64bc269a47ba7d5 100644 (file)
@@ -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);
index 96b606951d6b852e74a762beaf882119c310f28b..b74cbb0bca730fcf341f055cb9acd17f8ba67c2b 100644 (file)
@@ -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")