diff options
author | Mike Stump <mrs@gcc.gnu.org> | 2003-01-28 19:40:46 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2003-01-28 19:40:46 +0000 |
commit | 1f80c9ef1695ef6b3c26deeb059c5995f6ff56fd (patch) | |
tree | a9e751c12051c1b66adda96fd5b4f24f86db3ebc /gcc/regclass.c | |
parent | 9fbd3e416654b42041026f9d51d1115a42dd5d34 (diff) | |
download | gcc-1f80c9ef1695ef6b3c26deeb059c5995f6ff56fd.zip gcc-1f80c9ef1695ef6b3c26deeb059c5995f6ff56fd.tar.gz gcc-1f80c9ef1695ef6b3c26deeb059c5995f6ff56fd.tar.bz2 |
regclass.c (init_reg_autoinc): New function.
* 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.
From-SVN: r62006
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r-- | gcc/regclass.c | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c index 21cb6ea..ea6c86b 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 |