diff mbox

[IRA] save a call to init_reload

Message ID 1460345085-30244-1-git-send-email-zhouzhouyi@gmail.com
State New
Headers show

Commit Message

Zhouyi Zhou April 11, 2016, 3:24 a.m. UTC
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(-)

Comments

Vladimir Makarov April 12, 2016, 2:10 a.m. UTC | #1
On 04/10/2016 11:24 PM, Zhouyi Zhou wrote:
> 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.

Thank you for the patch.  The toplev.c part of the patch is ok for stage 1.

As for reload1.c part, I don't see what you actually changed.


> 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 ();
Zhouyi Zhou April 12, 2016, 8:22 a.m. UTC | #2
Thanks Vladimir for reviewing my patch.

> Thank you for the patch.  The toplev.c part of the patch is ok for stage 1.
> 
> As for reload1.c part, I don't see what you actually changed.
> 
Please forgive my innocence, I have mistakenly thought the form-feed character "^L" in line 415 
is a type error. 


Cheers
Zhouyi
Jeff Law April 26, 2016, 8:52 p.m. UTC | #3
On 04/11/2016 08:10 PM, Vladimir Makarov wrote:
> On 04/10/2016 11:24 PM, Zhouyi Zhou wrote:
>> 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.
>
> Thank you for the patch.  The toplev.c part of the patch is ok for stage 1.
And I've committed it to the trunk.

jeff
diff mbox

Patch

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 ();