Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-23 Thread Chung-Ju Wu
2014-08-22 1:45 GMT+08:00 Joseph S. Myers jos...@codesourcery.com:
 On Thu, 21 Aug 2014, Richard Earnshaw wrote:

 On 19/08/14 15:24, Kito Cheng wrote:
  Hi Richard:
  Hmm, I'm not sure about this.  It might not be used at present, but on:
  AArch64, with more call-clobbered registers than call-saved registers, I
  would expect this ought to be a win.  The fact that it isn't on today
  may say more about the way it works than the concept that it's the wrong
  thing to do in principle.
 
  In my view, calculate cost/profit should be done by register allocator 
  instead
  of a target hook/marco is more reasonable since register allocator can
  have more globe view to it, and IRA do it now.
 
  And as Joseph say, no code calling it, so I think it's time to remove it.
  thanks for your comment :)

 Objection withdrawn.

 Thanks.  The patch is OK.


Hi, Joseph,

Kito talked to me that he has signed FSF agreement
but has not got his svn write access yet.
So I help to commit this patch for him (Rev.214405).
  https://gcc.gnu.org/r214405

I think he needs to finish this form
https://sourceware.org/cgi-bin/pdw/ps_form.cgi
so that he can commit patches on his own in the future.
Could Kito list you as the one who approve his write access request?
Or could you suggest someone who may help with it? :)


Best regards,
jasonwucj


 --
 Joseph S. Myers
 jos...@codesourcery.com


Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-21 Thread Richard Earnshaw
On 19/08/14 15:24, Kito Cheng wrote:
 Hi Richard:
 Hmm, I'm not sure about this.  It might not be used at present, but on:
 AArch64, with more call-clobbered registers than call-saved registers, I
 would expect this ought to be a win.  The fact that it isn't on today
 may say more about the way it works than the concept that it's the wrong
 thing to do in principle.
 
 In my view, calculate cost/profit should be done by register allocator instead
 of a target hook/marco is more reasonable since register allocator can
 have more globe view to it, and IRA do it now.
 
 And as Joseph say, no code calling it, so I think it's time to remove it.
 thanks for your comment :)
 
 

Objection withdrawn.

R.

 
 Hi Joseph:
 
 Nothing uses it - not just no targets defining it, but no code calling it.
 If you have a use in future for a target hook doing something suggested by
 the name of this macro, by all means add one - but there's no point at all
 in keeping the macro until then.  (It should of course be poisoned in
 system.h when removing it, as standard when removing target macros.)
 Thanks, I add poison for CALLER_SAVE_PROFITABLE to system.h,
  updated patch attached.
 
 thanks for your review :)
 
 ChangLog
 2014-08-19  Kito Cheng  k...@0xlab.org
 
 * system.h (CALLER_SAVE_PROFITABLE): Poison.
 * doc/tm.texi.in (CALLER_SAVE_PROFITABLE): Remove.
 * gcc/doc/tm.texi: Regenerate.
 * gcc/regs.h (CALLER_SAVE_PROFITABLE): Remove.
 
 On Tue, Aug 19, 2014 at 4:26 AM, Joseph S. Myers
 jos...@codesourcery.com wrote:
 On Mon, 18 Aug 2014, Richard Earnshaw wrote:

 Hmm, I'm not sure about this.  It might not be used at present, but on
 AArch64, with more call-clobbered registers than call-saved registers, I
 would expect this ought to be a win.  The fact that it isn't on today
 may say more about the way it works than the concept that it's the wrong
 thing to do in principle.

 Nothing uses it - not just no targets defining it, but no code calling it.
 If you have a use in future for a target hook doing something suggested by
 the name of this macro, by all means add one - but there's no point at all
 in keeping the macro until then.  (It should of course be poisoned in
 system.h when removing it, as standard when removing target macros.)

 --
 Joseph S. Myers
 jos...@codesourcery.com

 0001-Remove-CALLER_SAVE_PROFITABLE-since-nobody-use-it-no.patch


 From 6a99f77eb6785c8d471329bda4bc67885f35909a Mon Sep 17 00:00:00 2001
 From: Kito Cheng k...@0xlab.org
 Date: Tue, 19 Aug 2014 22:10:47 +0800
 Subject: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now.

 ---
  gcc/doc/tm.texi| 10 --
  gcc/doc/tm.texi.in | 10 --
  gcc/regs.h |  8 
  gcc/system.h   |  3 ++-
  4 files changed, 2 insertions(+), 29 deletions(-)

 diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
 index 9dd8d68..4d6492b 100644
 --- a/gcc/doc/tm.texi
 +++ b/gcc/doc/tm.texi
 @@ -4528,16 +4528,6 @@ If you enable it, GCC can save registers around 
 function calls.  This
  makes it possible to use call-clobbered registers to hold variables that
  must live across calls.
  
 -@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
 -A C expression to determine whether it is worthwhile to consider placing
 -a pseudo-register in a call-clobbered hard register and saving and
 -restoring it around each function call.  The expression should be 1 when
 -this is worth doing, and 0 otherwise.
 -
 -If you don't define this macro, a default is used which is good on most
 -machines: @code{4 * @var{calls}  @var{refs}}.
 -@end defmac
 -
  @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
  A C expression specifying which mode is required for saving @var{nregs}
  of a pseudo-register in call-clobbered hard register @var{regno}.  If
 diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
 index dd72b98..7a63353 100644
 --- a/gcc/doc/tm.texi.in
 +++ b/gcc/doc/tm.texi.in
 @@ -3683,16 +3683,6 @@ If you enable it, GCC can save registers around 
 function calls.  This
  makes it possible to use call-clobbered registers to hold variables that
  must live across calls.
  
 -@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
 -A C expression to determine whether it is worthwhile to consider placing
 -a pseudo-register in a call-clobbered hard register and saving and
 -restoring it around each function call.  The expression should be 1 when
 -this is worth doing, and 0 otherwise.
 -
 -If you don't define this macro, a default is used which is good on most
 -machines: @code{4 * @var{calls}  @var{refs}}.
 -@end defmac
 -
  @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
  A C expression specifying which mode is required for saving @var{nregs}
  of a pseudo-register in call-clobbered hard register @var{regno}.  If
 diff --git a/gcc/regs.h b/gcc/regs.h
 index be81db4..36e803d 100644
 --- a/gcc/regs.h
 +++ b/gcc/regs.h
 @@ -214,14 +214,6 @@ extern short *reg_renumber;
  
  extern int

Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-21 Thread Joseph S. Myers
On Thu, 21 Aug 2014, Richard Earnshaw wrote:

 On 19/08/14 15:24, Kito Cheng wrote:
  Hi Richard:
  Hmm, I'm not sure about this.  It might not be used at present, but on:
  AArch64, with more call-clobbered registers than call-saved registers, I
  would expect this ought to be a win.  The fact that it isn't on today
  may say more about the way it works than the concept that it's the wrong
  thing to do in principle.
  
  In my view, calculate cost/profit should be done by register allocator 
  instead
  of a target hook/marco is more reasonable since register allocator can
  have more globe view to it, and IRA do it now.
  
  And as Joseph say, no code calling it, so I think it's time to remove it.
  thanks for your comment :)
 
 Objection withdrawn.

Thanks.  The patch is OK.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-19 Thread Kito Cheng
Hi Richard:
Hmm, I'm not sure about this.  It might not be used at present, but on:
AArch64, with more call-clobbered registers than call-saved registers, I
would expect this ought to be a win.  The fact that it isn't on today
may say more about the way it works than the concept that it's the wrong
thing to do in principle.

In my view, calculate cost/profit should be done by register allocator instead
of a target hook/marco is more reasonable since register allocator can
have more globe view to it, and IRA do it now.

And as Joseph say, no code calling it, so I think it's time to remove it.
thanks for your comment :)



Hi Joseph:

 Nothing uses it - not just no targets defining it, but no code calling it.
 If you have a use in future for a target hook doing something suggested by
 the name of this macro, by all means add one - but there's no point at all
 in keeping the macro until then.  (It should of course be poisoned in
 system.h when removing it, as standard when removing target macros.)
Thanks, I add poison for CALLER_SAVE_PROFITABLE to system.h,
 updated patch attached.

thanks for your review :)

ChangLog
2014-08-19  Kito Cheng  k...@0xlab.org

* system.h (CALLER_SAVE_PROFITABLE): Poison.
* doc/tm.texi.in (CALLER_SAVE_PROFITABLE): Remove.
* gcc/doc/tm.texi: Regenerate.
* gcc/regs.h (CALLER_SAVE_PROFITABLE): Remove.

On Tue, Aug 19, 2014 at 4:26 AM, Joseph S. Myers
jos...@codesourcery.com wrote:
 On Mon, 18 Aug 2014, Richard Earnshaw wrote:

 Hmm, I'm not sure about this.  It might not be used at present, but on
 AArch64, with more call-clobbered registers than call-saved registers, I
 would expect this ought to be a win.  The fact that it isn't on today
 may say more about the way it works than the concept that it's the wrong
 thing to do in principle.

 Nothing uses it - not just no targets defining it, but no code calling it.
 If you have a use in future for a target hook doing something suggested by
 the name of this macro, by all means add one - but there's no point at all
 in keeping the macro until then.  (It should of course be poisoned in
 system.h when removing it, as standard when removing target macros.)

 --
 Joseph S. Myers
 jos...@codesourcery.com
From 6a99f77eb6785c8d471329bda4bc67885f35909a Mon Sep 17 00:00:00 2001
From: Kito Cheng k...@0xlab.org
Date: Tue, 19 Aug 2014 22:10:47 +0800
Subject: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now.

---
 gcc/doc/tm.texi| 10 --
 gcc/doc/tm.texi.in | 10 --
 gcc/regs.h |  8 
 gcc/system.h   |  3 ++-
 4 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 9dd8d68..4d6492b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -4528,16 +4528,6 @@ If you enable it, GCC can save registers around function calls.  This
 makes it possible to use call-clobbered registers to hold variables that
 must live across calls.
 
-@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
-A C expression to determine whether it is worthwhile to consider placing
-a pseudo-register in a call-clobbered hard register and saving and
-restoring it around each function call.  The expression should be 1 when
-this is worth doing, and 0 otherwise.
-
-If you don't define this macro, a default is used which is good on most
-machines: @code{4 * @var{calls}  @var{refs}}.
-@end defmac
-
 @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
 A C expression specifying which mode is required for saving @var{nregs}
 of a pseudo-register in call-clobbered hard register @var{regno}.  If
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index dd72b98..7a63353 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3683,16 +3683,6 @@ If you enable it, GCC can save registers around function calls.  This
 makes it possible to use call-clobbered registers to hold variables that
 must live across calls.
 
-@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
-A C expression to determine whether it is worthwhile to consider placing
-a pseudo-register in a call-clobbered hard register and saving and
-restoring it around each function call.  The expression should be 1 when
-this is worth doing, and 0 otherwise.
-
-If you don't define this macro, a default is used which is good on most
-machines: @code{4 * @var{calls}  @var{refs}}.
-@end defmac
-
 @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
 A C expression specifying which mode is required for saving @var{nregs}
 of a pseudo-register in call-clobbered hard register @var{regno}.  If
diff --git a/gcc/regs.h b/gcc/regs.h
index be81db4..36e803d 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -214,14 +214,6 @@ extern short *reg_renumber;
 
 extern int caller_save_needed;
 
-/* Predicate to decide whether to give a hard reg to a pseudo which
-   is referenced REFS times and would need to be saved and restored
-   around a call CALLS times.  */
-
-#ifndef CALLER_SAVE_PROFITABLE

[PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-18 Thread Kito Cheng
Hi all:

This patch clean up CALLER_SAVE_PROFITABLE marco include doc since
seem nobody use it.

Bootstrap and regression testing running on x86_64-unknown-linux-gnu :)

ChangLog
2014-08-18  Kito Cheng  k...@0xlab.org

* doc/tm.texi.in (CALLER_SAVE_PROFITABLE): Remove.
* gcc/doc/tm.texi: Regenerate.
* gcc/regs.h (CALLER_SAVE_PROFITABLE): Remove.
From c8aeb654e6eaaeb07a1cde9a83a6340a901a4d3c Mon Sep 17 00:00:00 2001
From: Kito Cheng k...@0xlab.org
Date: Mon, 18 Aug 2014 22:09:22 +0800
Subject: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now.

---
 gcc/doc/tm.texi| 10 --
 gcc/doc/tm.texi.in | 10 --
 gcc/regs.h |  8 
 3 files changed, 28 deletions(-)

diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 9dd8d68..4d6492b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -4528,16 +4528,6 @@ If you enable it, GCC can save registers around function calls.  This
 makes it possible to use call-clobbered registers to hold variables that
 must live across calls.
 
-@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
-A C expression to determine whether it is worthwhile to consider placing
-a pseudo-register in a call-clobbered hard register and saving and
-restoring it around each function call.  The expression should be 1 when
-this is worth doing, and 0 otherwise.
-
-If you don't define this macro, a default is used which is good on most
-machines: @code{4 * @var{calls}  @var{refs}}.
-@end defmac
-
 @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
 A C expression specifying which mode is required for saving @var{nregs}
 of a pseudo-register in call-clobbered hard register @var{regno}.  If
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index dd72b98..7a63353 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3683,16 +3683,6 @@ If you enable it, GCC can save registers around function calls.  This
 makes it possible to use call-clobbered registers to hold variables that
 must live across calls.
 
-@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
-A C expression to determine whether it is worthwhile to consider placing
-a pseudo-register in a call-clobbered hard register and saving and
-restoring it around each function call.  The expression should be 1 when
-this is worth doing, and 0 otherwise.
-
-If you don't define this macro, a default is used which is good on most
-machines: @code{4 * @var{calls}  @var{refs}}.
-@end defmac
-
 @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
 A C expression specifying which mode is required for saving @var{nregs}
 of a pseudo-register in call-clobbered hard register @var{regno}.  If
diff --git a/gcc/regs.h b/gcc/regs.h
index be81db4..36e803d 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -214,14 +214,6 @@ extern short *reg_renumber;
 
 extern int caller_save_needed;
 
-/* Predicate to decide whether to give a hard reg to a pseudo which
-   is referenced REFS times and would need to be saved and restored
-   around a call CALLS times.  */
-
-#ifndef CALLER_SAVE_PROFITABLE
-#define CALLER_SAVE_PROFITABLE(REFS, CALLS)  (4 * (CALLS)  (REFS))
-#endif
-
 /* Select a register mode required for caller save of hard regno REGNO.  */
 #ifndef HARD_REGNO_CALLER_SAVE_MODE
 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
-- 
1.9.3



Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-18 Thread Richard Earnshaw
On 18/08/14 15:48, Kito Cheng wrote:
 Hi all:
 
 This patch clean up CALLER_SAVE_PROFITABLE marco include doc since
 seem nobody use it.
 
 Bootstrap and regression testing running on x86_64-unknown-linux-gnu :)
 
 ChangLog
 2014-08-18  Kito Cheng  k...@0xlab.org
 
 * doc/tm.texi.in (CALLER_SAVE_PROFITABLE): Remove.
 * gcc/doc/tm.texi: Regenerate.
 * gcc/regs.h (CALLER_SAVE_PROFITABLE): Remove.
 
 

Hmm, I'm not sure about this.  It might not be used at present, but on
AArch64, with more call-clobbered registers than call-saved registers, I
would expect this ought to be a win.  The fact that it isn't on today
may say more about the way it works than the concept that it's the wrong
thing to do in principle.

R.

 0001-Remove-CALLER_SAVE_PROFITABLE-since-nobody-use-it-no.patch
 
 
 From c8aeb654e6eaaeb07a1cde9a83a6340a901a4d3c Mon Sep 17 00:00:00 2001
 From: Kito Cheng k...@0xlab.org
 Date: Mon, 18 Aug 2014 22:09:22 +0800
 Subject: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now.
 
 ---
  gcc/doc/tm.texi| 10 --
  gcc/doc/tm.texi.in | 10 --
  gcc/regs.h |  8 
  3 files changed, 28 deletions(-)
 
 diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
 index 9dd8d68..4d6492b 100644
 --- a/gcc/doc/tm.texi
 +++ b/gcc/doc/tm.texi
 @@ -4528,16 +4528,6 @@ If you enable it, GCC can save registers around 
 function calls.  This
  makes it possible to use call-clobbered registers to hold variables that
  must live across calls.
  
 -@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
 -A C expression to determine whether it is worthwhile to consider placing
 -a pseudo-register in a call-clobbered hard register and saving and
 -restoring it around each function call.  The expression should be 1 when
 -this is worth doing, and 0 otherwise.
 -
 -If you don't define this macro, a default is used which is good on most
 -machines: @code{4 * @var{calls}  @var{refs}}.
 -@end defmac
 -
  @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
  A C expression specifying which mode is required for saving @var{nregs}
  of a pseudo-register in call-clobbered hard register @var{regno}.  If
 diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
 index dd72b98..7a63353 100644
 --- a/gcc/doc/tm.texi.in
 +++ b/gcc/doc/tm.texi.in
 @@ -3683,16 +3683,6 @@ If you enable it, GCC can save registers around 
 function calls.  This
  makes it possible to use call-clobbered registers to hold variables that
  must live across calls.
  
 -@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
 -A C expression to determine whether it is worthwhile to consider placing
 -a pseudo-register in a call-clobbered hard register and saving and
 -restoring it around each function call.  The expression should be 1 when
 -this is worth doing, and 0 otherwise.
 -
 -If you don't define this macro, a default is used which is good on most
 -machines: @code{4 * @var{calls}  @var{refs}}.
 -@end defmac
 -
  @defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
  A C expression specifying which mode is required for saving @var{nregs}
  of a pseudo-register in call-clobbered hard register @var{regno}.  If
 diff --git a/gcc/regs.h b/gcc/regs.h
 index be81db4..36e803d 100644
 --- a/gcc/regs.h
 +++ b/gcc/regs.h
 @@ -214,14 +214,6 @@ extern short *reg_renumber;
  
  extern int caller_save_needed;
  
 -/* Predicate to decide whether to give a hard reg to a pseudo which
 -   is referenced REFS times and would need to be saved and restored
 -   around a call CALLS times.  */
 -
 -#ifndef CALLER_SAVE_PROFITABLE
 -#define CALLER_SAVE_PROFITABLE(REFS, CALLS)  (4 * (CALLS)  (REFS))
 -#endif
 -
  /* Select a register mode required for caller save of hard regno REGNO.  */
  #ifndef HARD_REGNO_CALLER_SAVE_MODE
  #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
 




Re: [PATCH] Remove CALLER_SAVE_PROFITABLE since nobody use it now

2014-08-18 Thread Joseph S. Myers
On Mon, 18 Aug 2014, Richard Earnshaw wrote:

 Hmm, I'm not sure about this.  It might not be used at present, but on
 AArch64, with more call-clobbered registers than call-saved registers, I
 would expect this ought to be a win.  The fact that it isn't on today
 may say more about the way it works than the concept that it's the wrong
 thing to do in principle.

Nothing uses it - not just no targets defining it, but no code calling it.  
If you have a use in future for a target hook doing something suggested by 
the name of this macro, by all means add one - but there's no point at all 
in keeping the macro until then.  (It should of course be poisoned in 
system.h when removing it, as standard when removing target macros.)

-- 
Joseph S. Myers
jos...@codesourcery.com