Commit 6df26b8f by Jan Hubicka Committed by Jan Hubicka

regclass.c (contains_reg_of_mode): Make global.

	* regclass.c (contains_reg_of_mode): Make global.
	(init_reg_sets): Remove contains_reg_of_mode; take into account
	CLASS_MAX_NREGS when looking for the proper mode.
	(dump_regclass): Dump only classes considered for the pseudo.
	(regclass): Use contains_reg_of_mode.

From-SVN: r39891
parent 4a88a060
Mon Feb 19 16:47:39 CET 2001 Jan Hubicka <jh@suse.cz>
* regclass.c (contains_reg_of_mode): Make global.
(init_reg_sets): Remove contains_reg_of_mode; take into account
CLASS_MAX_NREGS when looking for the proper mode.
(dump_regclass): Dump only classes considered for the pseudo.
(regclass): Use contains_reg_of_mode.
Mon Feb 19 16:45:42 CET 2001 Jan Hubicka <jh@suse.cz> Mon Feb 19 16:45:42 CET 2001 Jan Hubicka <jh@suse.cz>
* gcc.c (do_spec_1): 'n' for printing notices. * gcc.c (do_spec_1): 'n' for printing notices.
......
...@@ -174,6 +174,10 @@ const char * reg_names[] = REGISTER_NAMES; ...@@ -174,6 +174,10 @@ const char * reg_names[] = REGISTER_NAMES;
enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER]; enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
/* 1 if class does contain register of given mode. */
static char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
/* Maximum cost of moving from a register in one class to a register in /* Maximum cost of moving from a register in one class to a register in
another class. Based on REGISTER_MOVE_COST. */ another class. Based on REGISTER_MOVE_COST. */
...@@ -288,7 +292,6 @@ init_reg_sets_1 () ...@@ -288,7 +292,6 @@ init_reg_sets_1 ()
{ {
register unsigned int i, j; register unsigned int i, j;
register unsigned int /* enum machine_mode */ m; register unsigned int /* enum machine_mode */ m;
char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
char allocatable_regs_of_mode [MAX_MACHINE_MODE]; char allocatable_regs_of_mode [MAX_MACHINE_MODE];
/* This macro allows the fixed or call-used registers /* This macro allows the fixed or call-used registers
...@@ -429,14 +432,15 @@ init_reg_sets_1 () ...@@ -429,14 +432,15 @@ init_reg_sets_1 ()
memset (allocatable_regs_of_mode, 0, sizeof (allocatable_regs_of_mode)); memset (allocatable_regs_of_mode, 0, sizeof (allocatable_regs_of_mode));
for (m = 0; m < MAX_MACHINE_MODE; m++) for (m = 0; m < MAX_MACHINE_MODE; m++)
for (i = 0; i < N_REG_CLASSES; i++) for (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) if (CLASS_MAX_NREGS (i, m) <= reg_class_size[i])
if (!fixed_regs [j] && TEST_HARD_REG_BIT (reg_class_contents[i], j) for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
&& HARD_REGNO_MODE_OK (j, m)) if (!fixed_regs [j] && TEST_HARD_REG_BIT (reg_class_contents[i], j)
{ && HARD_REGNO_MODE_OK (j, m))
contains_reg_of_mode [i][m] = 1; {
allocatable_regs_of_mode [m] = 1; contains_reg_of_mode [i][m] = 1;
break; allocatable_regs_of_mode [m] = 1;
} break;
}
/* Initialize the move cost table. Find every subset of each class /* Initialize the move cost table. Find every subset of each class
and take the maximum cost of moving any subset to any other. */ and take the maximum cost of moving any subset to any other. */
...@@ -860,6 +864,15 @@ dump_regclass (dump) ...@@ -860,6 +864,15 @@ dump_regclass (dump)
{ {
fprintf (dump, " Register %i costs:", i); fprintf (dump, " Register %i costs:", i);
for (class = 0; class < N_REG_CLASSES; class++) for (class = 0; class < N_REG_CLASSES; class++)
if (contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
&& (!in_inc_dec[i] || !forbidden_inc_dec_class[class])
#endif
#ifdef CLASS_CANNOT_CHANGE_MODE
&& (!REGNO_REG_SET_P (reg_changes_mode, i)
|| class_can_change_mode [class])
#endif
)
fprintf (dump, " %s:%i", reg_class_names[(int) class], fprintf (dump, " %s:%i", reg_class_names[(int) class],
costs[i].cost[class]); costs[i].cost[class]);
fprintf (dump, " MEM:%i\n", costs[i].mem_cost); fprintf (dump, " MEM:%i\n", costs[i].mem_cost);
...@@ -1224,8 +1237,7 @@ regclass (f, nregs, dump) ...@@ -1224,8 +1237,7 @@ regclass (f, nregs, dump)
{ {
/* Ignore classes that are too small for this operand or /* Ignore classes that are too small for this operand or
invalid for a operand that was auto-incremented. */ invalid for a operand that was auto-incremented. */
if (CLASS_MAX_NREGS (class, PSEUDO_REGNO_MODE (i)) if (!contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)]
> reg_class_size[class]
#ifdef FORBIDDEN_INC_DEC_CLASSES #ifdef FORBIDDEN_INC_DEC_CLASSES
|| (in_inc_dec[i] && forbidden_inc_dec_class[class]) || (in_inc_dec[i] && forbidden_inc_dec_class[class])
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment