From c8a9f9bf2f66b56de7ce884ef251c167dbc0d4aa Mon Sep 17 00:00:00 2001 From: mrs Date: Tue, 28 Jan 2003 19:40:46 +0000 Subject: [PATCH] * regclass.c (init_reg_autoinc): New function. (regclass): Move initialization of forbidden_inc_dec_class from here... (init_regs): to here. Avoids reinitialization for each function, saving compilation time. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62006 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/regclass.c | 60 ++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51fed17af87..59d24797864 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ + 2003-01-23 Mike Stump + + * regclass.c (init_reg_autoinc): New function. + (regclass): Move initialization of forbidden_inc_dec_class from + here... + (init_regs): to here. Avoids reinitialization for each function, + saving compilation time. + 2003-01-28 Jason Merrill * cpplib.h (struct cpp_options): Add warn_deprecated field. diff --git a/gcc/regclass.c b/gcc/regclass.c index 21cb6ead80f..ea6c86b6c57 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static void init_reg_sets_1 PARAMS ((void)); static void init_reg_modes PARAMS ((void)); +static void init_reg_autoinc PARAMS ((void)); /* If we have auto-increment or auto-decrement and we can have secondary reloads, we are not allowed to use classes requiring secondary @@ -578,6 +579,8 @@ init_regs () init_reg_sets_1 (); init_reg_modes (); + + init_reg_autoinc (); } /* Initialize some fake stack-frame MEM references for use in @@ -1143,37 +1146,18 @@ scan_one_insn (insn, pass) return insn; } -/* This is a pass of the compiler that scans all instructions - and calculates the preferred class for each pseudo-register. - This information can be accessed later by calling `reg_preferred_class'. - This pass comes just before local register allocation. */ +/* Initialize information about which register classes can be used for + pseudos that are auto-incremented or auto-decremented. */ -void -regclass (f, nregs, dump) - rtx f; - int nregs; - FILE *dump; +static void +init_reg_autoinc () { - rtx insn; - int i; - int pass; - - init_recog (); - - costs = (struct costs *) xmalloc (nregs * sizeof (struct costs)); - #ifdef FORBIDDEN_INC_DEC_CLASSES - - in_inc_dec = (char *) xmalloc (nregs); - - /* Initialize information about which register classes can be used for - pseudos that are auto-incremented or auto-decremented. It would - seem better to put this in init_reg_sets, but we need to be able - to allocate rtx, which we can't do that early. */ + int i; for (i = 0; i < N_REG_CLASSES; i++) { - rtx r = gen_rtx_REG (VOIDmode, 0); + rtx r = gen_rtx_raw_REG (VOIDmode, 0); enum machine_mode m; int j; @@ -1214,6 +1198,32 @@ regclass (f, nregs, dump) } } #endif /* FORBIDDEN_INC_DEC_CLASSES */ +} + +/* This is a pass of the compiler that scans all instructions + and calculates the preferred class for each pseudo-register. + This information can be accessed later by calling `reg_preferred_class'. + This pass comes just before local register allocation. */ + +void +regclass (f, nregs, dump) + rtx f; + int nregs; + FILE *dump; +{ + rtx insn; + int i; + int pass; + + init_recog (); + + costs = (struct costs *) xmalloc (nregs * sizeof (struct costs)); + +#ifdef FORBIDDEN_INC_DEC_CLASSES + + in_inc_dec = (char *) xmalloc (nregs); + +#endif /* FORBIDDEN_INC_DEC_CLASSES */ /* Normally we scan the insns once and determine the best class to use for each register. However, if -fexpensive_optimizations are on, we do so -- 2.11.0