This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 04/16] gcc: Don't keep reinitializing RTL
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Mon, 1 Jun 2015 17:04:12 -0400
- Subject: [PATCH 04/16] gcc: Don't keep reinitializing RTL
- Authentication-results: sourceware.org; auth=none
- References: <1433192664-50156-1-git-send-email-dmalcolm at redhat dot com>
This may be something of a hack; it appears to work for x86_64.
Before:
initialize rtl : 1.50 (63%) usr 0.02 (10%) sys 1.34 (23%) wall 1156 kB ( 5%) ggc
rest of compilation : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.03 ( 1%) wall 232 kB ( 1%) ggc
TOTAL : 2.37 0.21 5.86 21438 kB
./test-benchmark.c.exe: 100 iterations at optlevel 0 took a total of 5.870s (0.059s per iteration)
After:
initialize rtl : 0.01 ( 1%) usr 0.01 ( 4%) sys 0.02 ( 0%) wall 12 kB ( 0%) ggc
rest of compilation : 0.03 ( 3%) usr 0.01 ( 4%) sys 0.03 ( 1%) wall 232 kB ( 1%) ggc
TOTAL : 1.03 0.24 4.53 20294 kB
./test-benchmark.c.exe: 100 iterations at optlevel 0 took a total of 4.530s (0.045s per iteration)
(i.e. saves about 10-15ms per iteration)
gcc/ChangeLog:
* ira-costs.c (ira_costs_c_finalize): Delete.
* ira.h (void ira_costs_c_finalize): Delete.
* toplev.c (lang_dependent_init_target): Remove assertion tha
this_target_rtl->target_specific_initialized is false.
(finalize): Remove call to lra_finish_once.
(toplev::finalize): Don't unset "rtl_initialized" and
"this_target_rtl->target_specific_initialized". Remove call t
ira_costs_c_finalize.
---
gcc/ira-costs.c | 6 ------
gcc/ira.h | 3 ---
gcc/toplev.c | 8 --------
3 files changed, 17 deletions(-)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index fa6aec4..cfe416d 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -2367,9 +2367,3 @@ ira_adjust_equiv_reg_cost (unsigned regno, int cost)
else
regno_equiv_gains[regno] += cost;
}
-
-void
-ira_costs_c_finalize (void)
-{
- this_target_ira_int->free_ira_costs ();
-}
diff --git a/gcc/ira.h b/gcc/ira.h
index 5b52cb1..306692d 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -206,7 +206,4 @@ extern bool ira_bad_reload_regno (int, rtx, rtx);
extern void ira_adjust_equiv_reg_cost (unsigned, int);
-/* ira-costs.c */
-extern void ira_costs_c_finalize (void);
-
#endif /* GCC_IRA_H */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 3527b5d..12806d0 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1806,8 +1806,6 @@ lang_dependent_init_target (void)
front end is initialized. It also depends on the HAVE_xxx macros
generated from the target machine description. */
init_optabs ();
-
- gcc_assert (!this_target_rtl->target_specific_initialized);
}
/* Perform initializations that are lang-dependent or target-dependent.
@@ -1998,8 +1996,6 @@ finalize (bool no_backend)
statistics_fini ();
g->get_passes ()->finish_optimization_passes ();
-
- lra_finish_once ();
}
if (mem_report)
@@ -2207,9 +2203,6 @@ toplev::main (int argc, char **argv)
void
toplev::finalize (void)
{
- rtl_initialized = false;
- this_target_rtl->target_specific_initialized = false;
-
/* Needs to be called before cgraph_c_finalize since it uses symtab. */
ipa_reference_c_finalize ();
@@ -2218,7 +2211,6 @@ toplev::finalize (void)
dwarf2out_c_finalize ();
gcse_c_finalize ();
ipa_cp_c_finalize ();
- ira_costs_c_finalize ();
params_c_finalize ();
finalize_options_struct (&global_options);
--
1.8.5.3