mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-15 07:40:29 +08:00
regclass.c (init_reg_sets): Move init of move cost tables...
* regclass.c (init_reg_sets): Move init of move cost tables... (init_reg_sets_1): ...to here. From-SVN: r18273
This commit is contained in:
parent
5cd4989aa1
commit
acbce66755
@ -1,3 +1,8 @@
|
||||
1998-02-26 Ken Raeburn <raeburn@cygnus.com>
|
||||
|
||||
* regclass.c (init_reg_sets): Move init of move cost tables...
|
||||
(init_reg_sets_1): ...to here.
|
||||
|
||||
Thu Feb 26 00:13:21 1998 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* choose-temp.c: Fix handling of sys/file.h to work in libiberty.
|
||||
|
@ -318,38 +318,6 @@ init_reg_sets ()
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the move cost table. Find every subset of each class
|
||||
and take the maximum cost of moving any subset to any other. */
|
||||
|
||||
for (i = 0; i < N_REG_CLASSES; i++)
|
||||
for (j = 0; j < N_REG_CLASSES; j++)
|
||||
{
|
||||
int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j);
|
||||
enum reg_class *p1, *p2;
|
||||
|
||||
for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
|
||||
if (*p2 != i)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
|
||||
|
||||
for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
|
||||
{
|
||||
if (*p1 != j)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
|
||||
|
||||
for (p2 = ®_class_subclasses[j][0];
|
||||
*p2 != LIM_REG_CLASSES; p2++)
|
||||
if (*p1 != *p2)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2));
|
||||
}
|
||||
|
||||
move_cost[i][j] = cost;
|
||||
|
||||
if (reg_class_subset_p (i, j))
|
||||
cost = 0;
|
||||
|
||||
may_move_cost[i][j] = cost;
|
||||
}
|
||||
|
||||
/* Do any additional initialization regsets may need */
|
||||
INIT_ONCE_REG_SET ();
|
||||
}
|
||||
@ -360,7 +328,7 @@ init_reg_sets ()
|
||||
static void
|
||||
init_reg_sets_1 ()
|
||||
{
|
||||
register int i;
|
||||
register int i, j;
|
||||
|
||||
/* This macro allows the fixed or call-used registers
|
||||
to depend on target flags. */
|
||||
@ -393,6 +361,38 @@ init_reg_sets_1 ()
|
||||
if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i)))
|
||||
SET_HARD_REG_BIT (losing_caller_save_reg_set, i);
|
||||
}
|
||||
|
||||
/* Initialize the move cost table. Find every subset of each class
|
||||
and take the maximum cost of moving any subset to any other. */
|
||||
|
||||
for (i = 0; i < N_REG_CLASSES; i++)
|
||||
for (j = 0; j < N_REG_CLASSES; j++)
|
||||
{
|
||||
int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j);
|
||||
enum reg_class *p1, *p2;
|
||||
|
||||
for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
|
||||
if (*p2 != i)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
|
||||
|
||||
for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
|
||||
{
|
||||
if (*p1 != j)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
|
||||
|
||||
for (p2 = ®_class_subclasses[j][0];
|
||||
*p2 != LIM_REG_CLASSES; p2++)
|
||||
if (*p1 != *p2)
|
||||
cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2));
|
||||
}
|
||||
|
||||
move_cost[i][j] = cost;
|
||||
|
||||
if (reg_class_subset_p (i, j))
|
||||
cost = 0;
|
||||
|
||||
may_move_cost[i][j] = cost;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute the table of register modes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user