mirror of git://gcc.gnu.org/git/gcc.git
ira.c (init_move_cost): Adjust local variable names to match file conventions.
gcc/ * ira.c (init_move_cost): Adjust local variable names to match file conventions. Use ira_assert instead of gcc_assert. From-SVN: r188044
This commit is contained in:
parent
e80ccebcd8
commit
ed9e2ed0aa
|
@ -1,3 +1,8 @@
|
||||||
|
2012-05-31 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
|
* ira.c (init_move_cost): Adjust local variable names to match
|
||||||
|
file conventions. Use ira_assert instead of gcc_assert.
|
||||||
|
|
||||||
2012-05-31 Richard Sandiford <rdsandiford@googlemail.com>
|
2012-05-31 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
* regs.h (move_table, move_cost, may_move_in_cost, may_move_out_cost):
|
* regs.h (move_table, move_cost, may_move_in_cost, may_move_out_cost):
|
||||||
|
|
92
gcc/ira.c
92
gcc/ira.c
|
@ -1461,90 +1461,92 @@ clarify_prohibited_class_mode_regs (void)
|
||||||
/* Initialize may_move_cost and friends for mode M. */
|
/* Initialize may_move_cost and friends for mode M. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_move_cost (enum machine_mode m)
|
init_move_cost (enum machine_mode mode)
|
||||||
{
|
{
|
||||||
static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES];
|
static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES];
|
||||||
bool all_match = true;
|
bool all_match = true;
|
||||||
unsigned int i, j;
|
unsigned int cl1, cl2;
|
||||||
|
|
||||||
gcc_assert (have_regs_of_mode[m]);
|
ira_assert (have_regs_of_mode[mode]);
|
||||||
for (i = 0; i < N_REG_CLASSES; i++)
|
for (cl1 = 0; cl1 < N_REG_CLASSES; cl1++)
|
||||||
if (contains_reg_of_mode[i][m])
|
if (contains_reg_of_mode[cl1][mode])
|
||||||
for (j = 0; j < N_REG_CLASSES; j++)
|
for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++)
|
||||||
{
|
{
|
||||||
int cost;
|
int cost;
|
||||||
if (!contains_reg_of_mode[j][m])
|
if (!contains_reg_of_mode[cl2][mode])
|
||||||
cost = 65535;
|
cost = 65535;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cost = register_move_cost (m, (enum reg_class) i,
|
cost = register_move_cost (mode, (enum reg_class) cl1,
|
||||||
(enum reg_class) j);
|
(enum reg_class) cl2);
|
||||||
gcc_assert (cost < 65535);
|
ira_assert (cost < 65535);
|
||||||
}
|
}
|
||||||
all_match &= (last_move_cost[i][j] == cost);
|
all_match &= (last_move_cost[cl1][cl2] == cost);
|
||||||
last_move_cost[i][j] = cost;
|
last_move_cost[cl1][cl2] = cost;
|
||||||
}
|
}
|
||||||
if (all_match && last_mode_for_init_move_cost != -1)
|
if (all_match && last_mode_for_init_move_cost != -1)
|
||||||
{
|
{
|
||||||
move_cost[m] = move_cost[last_mode_for_init_move_cost];
|
move_cost[mode] = move_cost[last_mode_for_init_move_cost];
|
||||||
may_move_in_cost[m] = may_move_in_cost[last_mode_for_init_move_cost];
|
may_move_in_cost[mode] = may_move_in_cost[last_mode_for_init_move_cost];
|
||||||
may_move_out_cost[m] = may_move_out_cost[last_mode_for_init_move_cost];
|
may_move_out_cost[mode] = may_move_out_cost[last_mode_for_init_move_cost];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
last_mode_for_init_move_cost = m;
|
last_mode_for_init_move_cost = mode;
|
||||||
move_cost[m] = (move_table *)xmalloc (sizeof (move_table)
|
move_cost[mode] = (move_table *)xmalloc (sizeof (move_table)
|
||||||
* N_REG_CLASSES);
|
* N_REG_CLASSES);
|
||||||
may_move_in_cost[m] = (move_table *)xmalloc (sizeof (move_table)
|
may_move_in_cost[mode] = (move_table *)xmalloc (sizeof (move_table)
|
||||||
* N_REG_CLASSES);
|
* N_REG_CLASSES);
|
||||||
may_move_out_cost[m] = (move_table *)xmalloc (sizeof (move_table)
|
may_move_out_cost[mode] = (move_table *)xmalloc (sizeof (move_table)
|
||||||
* N_REG_CLASSES);
|
* N_REG_CLASSES);
|
||||||
for (i = 0; i < N_REG_CLASSES; i++)
|
for (cl1 = 0; cl1 < N_REG_CLASSES; cl1++)
|
||||||
if (contains_reg_of_mode[i][m])
|
if (contains_reg_of_mode[cl1][mode])
|
||||||
for (j = 0; j < N_REG_CLASSES; j++)
|
for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++)
|
||||||
{
|
{
|
||||||
int cost;
|
int cost;
|
||||||
enum reg_class *p1, *p2;
|
enum reg_class *p1, *p2;
|
||||||
|
|
||||||
if (last_move_cost[i][j] == 65535)
|
if (last_move_cost[cl1][cl2] == 65535)
|
||||||
{
|
{
|
||||||
move_cost[m][i][j] = 65535;
|
move_cost[mode][cl1][cl2] = 65535;
|
||||||
may_move_in_cost[m][i][j] = 65535;
|
may_move_in_cost[mode][cl1][cl2] = 65535;
|
||||||
may_move_out_cost[m][i][j] = 65535;
|
may_move_out_cost[mode][cl1][cl2] = 65535;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cost = last_move_cost[i][j];
|
cost = last_move_cost[cl1][cl2];
|
||||||
|
|
||||||
for (p2 = ®_class_subclasses[j][0];
|
for (p2 = ®_class_subclasses[cl2][0];
|
||||||
*p2 != LIM_REG_CLASSES; p2++)
|
*p2 != LIM_REG_CLASSES; p2++)
|
||||||
if (*p2 != i && contains_reg_of_mode[*p2][m])
|
if (*p2 != cl1 && contains_reg_of_mode[*p2][mode])
|
||||||
cost = MAX (cost, move_cost[m][i][*p2]);
|
cost = MAX (cost, move_cost[mode][cl1][*p2]);
|
||||||
|
|
||||||
for (p1 = ®_class_subclasses[i][0];
|
for (p1 = ®_class_subclasses[cl1][0];
|
||||||
*p1 != LIM_REG_CLASSES; p1++)
|
*p1 != LIM_REG_CLASSES; p1++)
|
||||||
if (*p1 != j && contains_reg_of_mode[*p1][m])
|
if (*p1 != cl2 && contains_reg_of_mode[*p1][mode])
|
||||||
cost = MAX (cost, move_cost[m][*p1][j]);
|
cost = MAX (cost, move_cost[mode][*p1][cl2]);
|
||||||
|
|
||||||
gcc_assert (cost <= 65535);
|
ira_assert (cost <= 65535);
|
||||||
move_cost[m][i][j] = cost;
|
move_cost[mode][cl1][cl2] = cost;
|
||||||
|
|
||||||
if (reg_class_subset_p ((enum reg_class) i, (enum reg_class) j))
|
if (reg_class_subset_p ((enum reg_class) cl1,
|
||||||
may_move_in_cost[m][i][j] = 0;
|
(enum reg_class) cl2))
|
||||||
|
may_move_in_cost[mode][cl1][cl2] = 0;
|
||||||
else
|
else
|
||||||
may_move_in_cost[m][i][j] = cost;
|
may_move_in_cost[mode][cl1][cl2] = cost;
|
||||||
|
|
||||||
if (reg_class_subset_p ((enum reg_class) j, (enum reg_class) i))
|
if (reg_class_subset_p ((enum reg_class) cl2,
|
||||||
may_move_out_cost[m][i][j] = 0;
|
(enum reg_class) cl1))
|
||||||
|
may_move_out_cost[mode][cl1][cl2] = 0;
|
||||||
else
|
else
|
||||||
may_move_out_cost[m][i][j] = cost;
|
may_move_out_cost[mode][cl1][cl2] = cost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (j = 0; j < N_REG_CLASSES; j++)
|
for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++)
|
||||||
{
|
{
|
||||||
move_cost[m][i][j] = 65535;
|
move_cost[mode][cl1][cl2] = 65535;
|
||||||
may_move_in_cost[m][i][j] = 65535;
|
may_move_in_cost[mode][cl1][cl2] = 65535;
|
||||||
may_move_out_cost[m][i][j] = 65535;
|
may_move_out_cost[mode][cl1][cl2] = 65535;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue