public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5944] [PR99531] Modify pseudo class cost calculation when processing move involving the pseudo and a hard
@ 2021-12-13 19:11 Vladimir Makarov
0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2021-12-13 19:11 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a7acb6dca941db2b1c135107dac3a34a20650d5c
commit r12-5944-ga7acb6dca941db2b1c135107dac3a34a20650d5c
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date: Mon Dec 13 13:48:12 2021 -0500
[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.
Diff:
---
gcc/ira-costs.c | 22 +---------------------
gcc/testsuite/gcc.target/i386/pr99531.c | 7 +++++++
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index cb5ca8bc21b..d7191dcee3e 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -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;
}
}
diff --git a/gcc/testsuite/gcc.target/i386/pr99531.c b/gcc/testsuite/gcc.target/i386/pr99531.c
new file mode 100644
index 00000000000..0e1a08b7c77
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99531.c
@@ -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" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-13 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 19:11 [gcc r12-5944] [PR99531] Modify pseudo class cost calculation when processing move involving the pseudo and a hard Vladimir Makarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).