This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH IRA] save a call to init_reload
- From: Zhouyi Zhou <zhouzhouyi at gmail dot com>
- To: vmakarov at redhat dot com, gcc-patches at gcc dot gnu dot org
- Cc: Zhouyi Zhou <zhouzhouyi at gmail dot com>, Zhouyi Zhou <yizhouzhou at ict dot ac dot cn>
- Date: Mon, 11 Apr 2016 11:24:45 +0800
- Subject: [PATCH IRA] save a call to init_reload
- Authentication-results: sourceware.org; auth=none
save a function call to init_reload when using lra, also remove the a
type error in reload1.c
because init_reload is called only once when compile process, the
performance reduction may not be significant when compiling multi function
source files.
performance evaluation using valgrind (gcc.c-torture/compile/simd-6.c):
valgrind --tool=lackey --log-file=tmp1 ../gcc/cc1.orig -O2 simd-6.c 2>/dev/null
valgrind --tool=lackey --log-file=tmp ../gcc/cc1 -O2 simd-6.c 2>/dev/null
orig:
==1139== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==1139== Command: ../gcc/cc1.orig -O2 simd-6.c
==1139== Parent PID: 14895
==1139==
==1139==
==1139== Counted 1 call to main()
==1139==
==1139== Jccs:
==1139== total: 2,309,094
==1139== taken: 960,254 (42%)
==1139==
==1139== Executed:
==1139== SBs entered: 2,671,880
==1139== SBs completed: 1,662,561
==1139== guest instrs: 15,729,468
==1139== IRStmts: 93,198,764
after:
==1142== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==1142== Command: ../gcc/cc1 -O2 simd-6.c
==1142== Parent PID: 14895
==1142==
==1142==
==1142== Counted 1 call to main()
==1142==
==1142== Jccs:
==1142== total: 2,306,506
==1142== taken: 959,362 (42%)
==1142==
==1142== Executed:
==1142== SBs entered: 2,669,050
==1142== SBs completed: 1,660,884
==1142== guest instrs: 15,714,064
==1142== IRStmts: 93,106,144
bootstrapped and checked on x86-64
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
---
gcc/ChangeLog | 9 +++++++++
gcc/reload1.c | 2 +-
gcc/toplev.c | 3 ++-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d9a94d..9f78348 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2016-04-11 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+ * toplev.c (backend_init_target): save a function call to init_reload
+ when using lra.
+
+2016-04-11 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+ * reload1.c : fix a type error in reload1.c.
+
2016-04-09 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68953
diff --git a/gcc/reload1.c b/gcc/reload1.c
index c2800f8..8310dc5 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -412,7 +412,7 @@ static bool gen_reload_chain_without_interm_reg_p (int, int);
static int reloads_conflict (int, int);
static rtx_insn *gen_reload (rtx, rtx, int, enum reload_type);
static rtx_insn *emit_insn_if_valid_for_reload (rtx);
-
+
/* Initialize the reload pass. This is called at the beginning of compilation
and may be called again if the target is reinitialized. */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index c480bfc..14ac9c5 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1620,7 +1620,8 @@ backend_init_target (void)
init_alias_target ();
/* Depends on HARD_FRAME_POINTER_REGNUM. */
- init_reload ();
+ if (!ira_use_lra_p)
+ init_reload ();
/* Depends on the enabled attribute. */
recog_init ();
--
1.9.1