diff mbox

Remove CALLER_SAVE_PROFITABLE since nobody use it now

Message ID CA+yXCZAMrSt9EbnaLLJkMwt8-_oX9r6etLiXGF8PDX6rGYQZHQ@mail.gmail.com
State New
Headers show

Commit Message

Kito Cheng Aug. 18, 2014, 2:48 p.m. UTC
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  <kito@0xlab.org>

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

Comments

Richard Earnshaw Aug. 18, 2014, 2:56 p.m. UTC | #1
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  <kito@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 <kito@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) \
>
Joseph Myers Aug. 18, 2014, 8:26 p.m. UTC | #2
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.)
diff mbox

Patch

From c8aeb654e6eaaeb07a1cde9a83a6340a901a4d3c Mon Sep 17 00:00:00 2001
From: Kito Cheng <kito@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