]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Update documentation.
authorSteven Bosscher <steven@gcc.gnu.org>
Wed, 5 Dec 2012 23:16:52 +0000 (23:16 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Wed, 5 Dec 2012 23:16:52 +0000 (23:16 +0000)
* doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Update documentation.
* doc/tm.texi: Regenerate.
* regs.h (REG_LIVE_LENGTH): Update comments to not refer to no longer
existing files global.c and local-alloc.c.
* regmove.c (copy_src_to_dest): Likewise.
* function.h (struct rtl_data): Likewise.
* ira-color.c (allocno_priority_compare_func): Likewise.
* regstat.c (regstat_compute_ri): Likewise.
* config/epiphany/epiphany.h, config/vax/vax.h, config/cris/cris.h,
config/h8300/h8300.h, config/alpha/alpha.h, config/sparc/sparc.h,
config/rs6000/rs6000.h, config/pdp11/pdp11.h, config/pa/pa.h,
config/v850/v850.h, config/mn10300/mn10300.h, config/m32r/m32r.h,
config/i386/i386.h, config/mcore/mcore.h, config/sh/sh.h,
config/arm/arm.h (REGNO_OK_FOR_BASE_P): Likewise.

From-SVN: r194229

24 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha.h
gcc/config/arm/arm.h
gcc/config/cris/cris.h
gcc/config/epiphany/epiphany.h
gcc/config/h8300/h8300.h
gcc/config/i386/i386.h
gcc/config/m32r/m32r.h
gcc/config/mcore/mcore.h
gcc/config/mn10300/mn10300.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/rs6000/rs6000.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/v850/v850.h
gcc/config/vax/vax.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/function.h
gcc/ira-color.c
gcc/regmove.c
gcc/regs.h
gcc/regstat.c

index 652c05f75f586b8a88f4b66bf1673675055f3ceb..efeafd3c73b1eac54d99b7b84f8fab3f15e864ff 100644 (file)
@@ -1,3 +1,20 @@
+2012-12-05  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Update documentation.
+       * doc/tm.texi: Regenerate.
+       * regs.h (REG_LIVE_LENGTH): Update comments to not refer to no longer
+       existing files global.c and local-alloc.c.
+       * regmove.c (copy_src_to_dest): Likewise.
+       * function.h (struct rtl_data): Likewise.
+       * ira-color.c (allocno_priority_compare_func): Likewise.
+       * regstat.c (regstat_compute_ri): Likewise.
+       * config/epiphany/epiphany.h, config/vax/vax.h, config/cris/cris.h,
+       config/h8300/h8300.h, config/alpha/alpha.h, config/sparc/sparc.h,
+       config/rs6000/rs6000.h, config/pdp11/pdp11.h, config/pa/pa.h,
+       config/v850/v850.h, config/mn10300/mn10300.h, config/m32r/m32r.h,
+       config/i386/i386.h, config/mcore/mcore.h, config/sh/sh.h,
+       config/arm/arm.h (REGNO_OK_FOR_BASE_P): Likewise.
+
 2012-12-05  Aldy Hernandez  <aldyh@redhat.com>
 
        PR target/54160
index cdb7c49b0076157b5d42edc22047e00e1c95d6c4..bc14d84055bb5a9eeac728911bed1a564fe47ca6 100644 (file)
@@ -778,7 +778,8 @@ extern int alpha_memory_latency;
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
 #define REGNO_OK_FOR_BASE_P(REGNO) \
index f520cc717aaf389b201dcdfb1f497f6c830cf253..d0f351d861ed0f0a853621b0fe07026f69964c31 100644 (file)
@@ -1730,7 +1730,8 @@ enum arm_auto_incmodes
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define TEST_REGNO(R, TEST, VALUE) \
   ((R TEST VALUE) || ((unsigned) reg_renumber[R] TEST VALUE))
 
index 646ba90b4b96f7a35dbc303bda5a867ec88c43d3..80fb8f3ad86a4aec4960f1ee50c604a0619c2a58 100644 (file)
@@ -577,7 +577,8 @@ enum reg_class
 #define INDEX_REG_CLASS GENERAL_REGS
 
 /* Since it uses reg_renumber, it is safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define REGNO_OK_FOR_BASE_P(REGNO)                                     \
  ((REGNO) <= CRIS_LAST_GENERAL_REGISTER                                        \
   || (REGNO) == ARG_POINTER_REGNUM                                     \
index c18aaa4194162f5de449a70a87ae5a111602b409..534f513132b96e5ec74052dc1ab18a6eb324966d 100644 (file)
@@ -407,7 +407,8 @@ extern enum reg_class epiphany_regno_reg_class[FIRST_PSEUDO_REGISTER];
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define REGNO_OK_FOR_BASE_P(REGNO) \
 ((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
 #define REGNO_OK_FOR_INDEX_P(REGNO) \
index 61e0dd2f84614c02a6b7075e53cde70e6b9f389e..b98f6169112f519a57f7c98d438f6b360f350574 100644 (file)
@@ -498,7 +498,8 @@ struct cum_arg
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(regno) 0
 
index 443d92eadceb7293f1f750c9070f7a9f1b256724..3ac345172c8291c59be282c855bad752369eb2ce 100644 (file)
@@ -1614,7 +1614,8 @@ typedef struct ix86_args {
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(REGNO)                                    \
   ((REGNO) < STACK_POINTER_REGNUM                                      \
index 0072b2f0da3eb6140ecee3b42318ced90766a2fe..e871328af7b557aefc20e043157c8356f3c02b60 100644 (file)
@@ -501,7 +501,8 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define REGNO_OK_FOR_BASE_P(REGNO) \
   ((REGNO) < FIRST_PSEUDO_REGISTER                     \
    ? GPR_P (REGNO) || (REGNO) == ARG_POINTER_REGNUM    \
index 398dcedfe22954072660bbd2cc1686067c864a3c..a64e4460fa18e7320e7112a44b68f25553242a11 100644 (file)
@@ -516,7 +516,8 @@ extern const enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 #define REGNO_OK_FOR_BASE_P(REGNO)  \
   ((REGNO) < AP_REG || (unsigned) reg_renumber[(REGNO)] < AP_REG)
 
index eb4f2f9f42fcf8410f035dc91f10d9550337bc92..4dea839873b78501c999110eee0eddaf319556e5 100644 (file)
@@ -347,7 +347,8 @@ enum reg_class
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #ifndef REG_OK_STRICT
 # define REG_STRICT 0
index 89665c1cddc03115252da2f91c34e9bf8a0b4907..29dbea012565fda5a7e09947834a9111993d0208 100644 (file)
@@ -750,7 +750,8 @@ extern int may_call_alloca;
    They give nonzero only if X is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(X) \
   ((X) && ((X) < 32                                                    \
index 6efbf49a074af5f54028ba329b9f527c3ecd6e00..76925b1683f8d4477d1982f34cd2504adbe17abc 100644 (file)
@@ -400,7 +400,8 @@ extern int may_call_alloca;
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_BASE_P(REGNO)  \
   ((REGNO) <= PC_REGNUM || (unsigned) reg_renumber[REGNO] <= PC_REGNUM || \
index f7b0be277769d9895b7b82984c95d9d9342400fd..2e23f6e523dae8b8ee2ba02a83d8cab213e54c4b 100644 (file)
@@ -1729,7 +1729,8 @@ typedef struct rs6000_args
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(REGNO)                            \
 ((REGNO) < FIRST_PSEUDO_REGISTER                               \
index fdd06a067c08260d06804cb6821151a996bdb748..212b97d9c10c834bc962c18f7ebd34ef29a02470 100644 (file)
@@ -1618,7 +1618,8 @@ struct sh_args {
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_BASE_P(REGNO) \
   (GENERAL_OR_AP_REGISTER_P (REGNO) \
index 57c5eaccdbf5cfe7096f4ce18226c1809e9b5e07..99c6a0393285e9b9ca3f50f989ae7074eef18d55 100644 (file)
@@ -1379,7 +1379,8 @@ do {                                                                      \
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(REGNO) \
 (SPARC_INT_REG_P (REGNO) || SPARC_INT_REG_P (reg_renumber[REGNO]) \
index e6458bcbaec2774c01e71d45e3e8324b23ae6f92..2e3e55a18fac13c6f29f20ece7163338f003d6c7 100644 (file)
@@ -354,7 +354,8 @@ enum reg_class
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
  
 #define REGNO_OK_FOR_BASE_P(regno)             \
   (((regno) < FIRST_PSEUDO_REGISTER            \
index 35b8f8ea93a6cf7d40809a2c51bd99be75b022a6..513ac6102db501a25ee49696e2b8e2e32b1327a6 100644 (file)
@@ -385,7 +385,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
-   has been allocated, which happens in local-alloc.c.  */
+   has been allocated, which happens in reginfo.c during register
+   allocation.  */
 
 #define REGNO_OK_FOR_INDEX_P(regno)    \
   ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
index f98196434f878cebcd7502f66e6fe66807f032ec..3ab99871c3b0746a0aeba0e08577db544ff5f73e 100644 (file)
@@ -2834,15 +2834,13 @@ registers of @var{rclass} are needed for spill registers.
 
 The default version of this target hook returns @code{true} if @var{rclass}
 has exactly one register and @code{false} otherwise.  On most machines, this
-default should be used.  Only use this target hook to some other expression
-if pseudos allocated by @file{local-alloc.c} end up in memory because their
-hard registers were needed for spill registers.  If this target hook returns
-@code{false} for those classes, those pseudos will only be allocated by
-@file{global.c}, which knows how to reallocate the pseudo to another
-register.  If there would not be another register available for reallocation,
-you should not change the implementation of this target hook since
-the only effect of such implementation would be to slow down register
-allocation.
+default should be used.  For generally register-starved machines, such as
+i386, or machines with right register constraints, such as SH, this hook
+can be used to avoid excessive spilling.
+
+This hook is also used by some of the global intra-procedural code
+transformations to throtle code motion, to avoid increasing register
+pressure.
 @end deftypefn
 
 @deftypefn {Target Hook} {unsigned char} TARGET_CLASS_MAX_NREGS (reg_class_t @var{rclass}, enum machine_mode @var{mode})
index 7a93f21073cbcb67388d909ea79d12f587dfd71a..6d48fe48b759fef271a5031f2d6234e102073594 100644 (file)
@@ -2810,15 +2810,13 @@ registers of @var{rclass} are needed for spill registers.
 
 The default version of this target hook returns @code{true} if @var{rclass}
 has exactly one register and @code{false} otherwise.  On most machines, this
-default should be used.  Only use this target hook to some other expression
-if pseudos allocated by @file{local-alloc.c} end up in memory because their
-hard registers were needed for spill registers.  If this target hook returns
-@code{false} for those classes, those pseudos will only be allocated by
-@file{global.c}, which knows how to reallocate the pseudo to another
-register.  If there would not be another register available for reallocation,
-you should not change the implementation of this target hook since
-the only effect of such implementation would be to slow down register
-allocation.
+default should be used.  For generally register-starved machines, such as
+i386, or machines with right register constraints, such as SH, this hook
+can be used to avoid excessive spilling.
+
+This hook is also used by some of the global intra-procedural code
+transformations to throtle code motion, to avoid increasing register
+pressure.
 @end deftypefn
 
 @hook TARGET_CLASS_MAX_NREGS
index dd7f099e8a5e6f6b3aa2a35b3d2e1fdfd71db253..65a7c48aa08d4933544e6b6c2bd26a069c935167 100644 (file)
@@ -389,7 +389,8 @@ struct GTY(()) rtl_data {
   bool arg_pointer_save_area_init;
 
   /* Nonzero if current function must be given a frame pointer.
-     Set in global.c if anything is allocated on the stack there.  */
+     Set in reload1.c or lra-eliminations.c if anything is allocated
+     on the stack there.  */
   bool frame_pointer_needed;
 
   /* When set, expand should optimize for speed.  */
index 33f9d24b00b52cab8e99c118fa9eff1b2968301f..3b9319ca7c5a5d20c35ab9526bb5ef5901c87a46 100644 (file)
@@ -2516,8 +2516,7 @@ improve_allocation (void)
     }
 }
 
-/* Sort allocnos according to their priorities which are calculated
-   analogous to ones in file `global.c'.  */
+/* Sort allocnos according to their priorities.  */
 static int
 allocno_priority_compare_func (const void *v1p, const void *v2p)
 {
index 29f6e6546b69710814df99e152a00d11aa0824e8..8dc2d54a674e4ecece8b8f61db4e49fe942e534c 100644 (file)
@@ -616,10 +616,10 @@ copy_src_to_dest (rtx insn, rtx src, rtx dest)
   int src_regno;
   int dest_regno;
 
-  /* A REG_LIVE_LENGTH of -1 indicates the register is equivalent to a constant
-     or memory location and is used infrequently; a REG_LIVE_LENGTH of -2 is
-     parameter when there is no frame pointer that is not allocated a register.
-     For now, we just reject them, rather than incrementing the live length.  */
+  /* A REG_LIVE_LENGTH of -1 indicates the register must not go into
+     a hard register, e.g. because it crosses as setjmp.  See the
+     comment in regstat.c:regstat_bb_compute_ri.  Don't try to apply
+     any transformations to such regs.  */
 
   if (REG_P (src)
       && REG_LIVE_LENGTH (REGNO (src)) > 0
index 4c9d7a6ce4218201b3f3ff880161f9c8ba85077d..adc9384b62e1f5da56df77cb2fa771aa5476314b 100644 (file)
@@ -176,21 +176,17 @@ extern size_t reg_info_p_size;
 
 #define REG_N_THROWING_CALLS_CROSSED(N) (reg_info_p[N].throw_calls_crossed)
 
-/* Total number of instructions at which (REG n) is live.  The larger
-   this is, the less priority (REG n) gets for allocation in a hard
-   register (in global-alloc).  This is set in df-problems.c whenever
-   register info is requested and remains valid for the rest of the
-   compilation of the function; it is used to control register
-   allocation.
-
-   local-alloc.c may alter this number to change the priority.
-
-   Negative values are special.
-   -1 is used to mark a pseudo reg which has a constant or memory equivalent
-   and is used infrequently enough that it should not get a hard register.
-   -2 is used to mark a pseudo reg for a parameter, when a frame pointer
-   is not required.  global.c makes an allocno for this but does
-   not try to assign a hard register to it.  */
+/* Total number of instructions at which (REG n) is live.
+   
+   This is set in regstat.c whenever register info is requested and
+   remains valid for the rest of the compilation of the function; it is
+   used to control register allocation.  The larger this is, the less
+   priority (REG n) gets for allocation in a hard register (in IRA in
+   priority-coloring mode).
+
+   Negative values are special: -1 is used to mark a pseudo reg that
+   should not be allocated to a hard register, because it crosses a
+   setjmp call.  */
 
 #define REG_LIVE_LENGTH(N)  (reg_info_p[N].live_length)
 
index ddfb404fbf2a2df10ccc3e16e5509a10277b4743..34eb7ad67bf2f5c38e6980f8f177856460666178 100644 (file)
@@ -389,7 +389,7 @@ regstat_compute_ri (void)
   BITMAP_FREE (local_processed);
   free (local_live_last_luid);
 
-  /* See the setjmp comment in regstat_ri_bb_compute.  */
+  /* See the setjmp comment in regstat_bb_compute_ri.  */
   EXECUTE_IF_SET_IN_BITMAP (setjmp_crosses, FIRST_PSEUDO_REGISTER, regno, bi)
     {
       REG_BASIC_BLOCK (regno) = REG_BLOCK_UNKNOWN;