public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org, binutils@sourceware.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [PATCH 04/16] gcc: Don't keep reinitializing RTL
Date: Mon, 01 Jun 2015 20:56:00 -0000	[thread overview]
Message-ID: <1433192664-50156-5-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1433192664-50156-1-git-send-email-dmalcolm@redhat.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

  parent reply	other threads:[~2015-06-01 20:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 20:50 [PATCH 00/16] RFC: Embedding as and ld inside gcc driver and into libgccjit David Malcolm
2015-06-01 20:50 ` [PATCH 01/16] gcc: Generalization of timevar API; add gcc_jit_timer interface David Malcolm
2015-06-01 20:50 ` [PATCH 05/16] gcc: driver: add g_driver singleton David Malcolm
2015-06-01 20:51 ` [PATCH 10/16] binutils: Introduce "gas_main", and state-purging with "gas" subdir David Malcolm
2015-06-01 20:51 ` [PATCH 15/16] gcc: Use libgas and libld within the driver David Malcolm
2015-06-02  8:32   ` Richard Biener
2015-06-02 11:07     ` Trevor Saunders
2015-06-02 12:12       ` Richard Biener
2015-06-01 20:55 ` [PATCH 07/16] binutils: bfd: Implement bfd_uninit David Malcolm
2015-06-01 20:55 ` [PATCH 09/16] libiberty.h: Provide CTIMER_PUSH/POP David Malcolm
2015-06-01 21:30   ` DJ Delorie
2015-06-02 21:52     ` Jeff Law
2015-06-01 20:55 ` [PATCH 06/16] gcc: driver: add timevars for as, collect2, ld David Malcolm
2015-06-01 20:55 ` [PATCH 08/16] libiberty.h: Provide a CLEAR_VAR macro David Malcolm
2015-06-01 21:47   ` DJ Delorie
2015-06-02  1:23     ` David Malcolm
2015-06-02  1:39       ` DJ Delorie
2015-06-01 20:56 ` David Malcolm [this message]
2015-06-01 20:58 ` [PATCH 02/16] gcc: Embed the driver in-process within libgccjit David Malcolm
2015-06-03  6:00   ` Bert Wesarg
2015-06-01 20:58 ` [PATCH 14/16] gcc: Add CTIMER_PUSH/POP to gcc's copy of libiberty David Malcolm
2015-06-01 21:33   ` DJ Delorie
2015-06-01 20:58 ` [PATCH 11/16] binutils: gas/Makefile.am: Add libgas.la David Malcolm
2015-06-01 20:59 ` [PATCH 12/16] binutils: Introduce "ld_main" and state-purging within "ld" subdir David Malcolm
2015-06-01 20:59 ` [PATCH 03/16] gcc: Use timevars within driver David Malcolm
2015-06-01 21:00 ` [PATCH 13/16] ld/Makefile.am: Introduce a libld.la David Malcolm
2015-06-01 21:00 ` [PATCH 16/16] gcc: Hack up the arguments to the linker David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433192664-50156-5-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).