Commit acbce667 by Ken Raeburn Committed by Ken Raeburn

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
parent 5cd4989a
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> 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. * choose-temp.c: Fix handling of sys/file.h to work in libiberty.
......
...@@ -318,38 +318,6 @@ init_reg_sets () ...@@ -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 = &reg_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
if (*p2 != i)
cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
for (p1 = &reg_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
{
if (*p1 != j)
cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
for (p2 = &reg_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 */ /* Do any additional initialization regsets may need */
INIT_ONCE_REG_SET (); INIT_ONCE_REG_SET ();
} }
...@@ -360,7 +328,7 @@ init_reg_sets () ...@@ -360,7 +328,7 @@ init_reg_sets ()
static void static void
init_reg_sets_1 () init_reg_sets_1 ()
{ {
register int i; register int i, j;
/* This macro allows the fixed or call-used registers /* This macro allows the fixed or call-used registers
to depend on target flags. */ to depend on target flags. */
...@@ -393,6 +361,38 @@ init_reg_sets_1 () ...@@ -393,6 +361,38 @@ init_reg_sets_1 ()
if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i))) if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i)))
SET_HARD_REG_BIT (losing_caller_save_reg_set, 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 = &reg_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
if (*p2 != i)
cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
for (p1 = &reg_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
{
if (*p1 != j)
cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
for (p2 = &reg_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. /* Compute the table of register modes.
......
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