[PR99531] Modify pseudo class cost calculation when processing move involving the pseudo and a hard register
Pseudo class calculated on the 1st iteration should not have a special treatment in cost calculation when processing move involving the pseudo and a hard register. gcc/ChangeLog: PR target/99531 * ira-costs.c (record_operand_costs): Do not take pseudo class calculated on the 1st iteration into account when processing move involving the pseudo and a hard register. gcc/testsuite/ChangeLog: PR target/99531 * gcc.target/i386/pr99531.c: New test.
This commit is contained in:
parent
149739c394
commit
a7acb6dca9
2 changed files with 8 additions and 21 deletions
|
@ -1310,7 +1310,7 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
|
|||
machine_mode mode = GET_MODE (SET_SRC (set));
|
||||
cost_classes_t cost_classes_ptr = regno_cost_classes[regno];
|
||||
enum reg_class *cost_classes = cost_classes_ptr->classes;
|
||||
reg_class_t rclass, hard_reg_class, pref_class, bigger_hard_reg_class;
|
||||
reg_class_t rclass, hard_reg_class, bigger_hard_reg_class;
|
||||
int cost, k;
|
||||
move_table *move_costs;
|
||||
bool dead_p = find_regno_note (insn, REG_DEAD, REGNO (src));
|
||||
|
@ -1336,23 +1336,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
|
|||
: move_costs[rclass][hard_reg_class]);
|
||||
|
||||
op_costs[i]->cost[k] = cost * frequency;
|
||||
/* If we have assigned a class to this allocno in our
|
||||
first pass, add a cost to this alternative
|
||||
corresponding to what we would add if this allocno
|
||||
were not in the appropriate class. */
|
||||
if (pref)
|
||||
{
|
||||
if ((pref_class = pref[COST_INDEX (regno)]) == NO_REGS)
|
||||
op_costs[i]->cost[k]
|
||||
+= ((i == 0 ? ira_memory_move_cost[mode][rclass][0] : 0)
|
||||
+ (i == 1 ? ira_memory_move_cost[mode][rclass][1] : 0)
|
||||
* frequency);
|
||||
else if (ira_reg_class_intersect[pref_class][rclass]
|
||||
== NO_REGS)
|
||||
op_costs[i]->cost[k]
|
||||
+= (move_costs[pref_class][rclass]
|
||||
* frequency);
|
||||
}
|
||||
/* If this insn is a single set copying operand 1 to
|
||||
operand 0 and one operand is an allocno with the
|
||||
other a hard reg or an allocno that prefers a hard
|
||||
|
@ -1378,9 +1361,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
|
|||
}
|
||||
op_costs[i]->mem_cost
|
||||
= ira_memory_move_cost[mode][hard_reg_class][i] * frequency;
|
||||
if (pref && (pref_class = pref[COST_INDEX (regno)]) != NO_REGS)
|
||||
op_costs[i]->mem_cost
|
||||
+= ira_memory_move_cost[mode][pref_class][i] * frequency;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
7
gcc/testsuite/gcc.target/i386/pr99531.c
Normal file
7
gcc/testsuite/gcc.target/i386/pr99531.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* { dg-do compile { target { x86_64-*-linux* } } } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
int func(int, int, int, int, int, int);
|
||||
int caller(int a, int b, int c, int d, int e) { return func(0, a, b, c, d, e); }
|
||||
|
||||
/* { dg-final { scan-assembler-not "push" } } */
|
Loading…
Add table
Reference in a new issue