diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2016-03-31 17:51:13 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2016-03-31 17:51:13 +0000 |
commit | c4b1942cb756ac17b818dc4150e05ceb032e98f8 (patch) | |
tree | 7801a3c0df05c7f60695ebbe68fb59e31da15483 | |
parent | 6f652a50723f0fe0f8b055a1f532058c1dce3c18 (diff) | |
download | gcc-c4b1942cb756ac17b818dc4150e05ceb032e98f8.zip gcc-c4b1942cb756ac17b818dc4150e05ceb032e98f8.tar.gz gcc-c4b1942cb756ac17b818dc4150e05ceb032e98f8.tar.bz2 |
re PR rtl-optimization/70461 (Performance regression after r234527)
2016-03-31 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/70461
* ira-color.c (allocno_copy_cost_saving): Use allocno class if it
is necessary.
From-SVN: r234649
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ira-color.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dac7727..123987e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-03-31 Vladimir Makarov <vmakarov@redhat.com> + + PR rtl-optimization/70461 + * ira-color.c (allocno_copy_cost_saving): Use allocno class if it + is necessary. + 2016-03-31 Martin Liska <mliska@suse.cz> PR hsa/70399 diff --git a/gcc/ira-color.c b/gcc/ira-color.c index fba8da4..8433479 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2734,10 +2734,16 @@ static int allocno_copy_cost_saving (ira_allocno_t allocno, int hard_regno) { int cost = 0; + enum machine_mode allocno_mode = ALLOCNO_MODE (allocno); enum reg_class rclass; ira_copy_t cp, next_cp; rclass = REGNO_REG_CLASS (hard_regno); + if (ira_reg_class_max_nregs[rclass][allocno_mode] + > ira_class_hard_regs_num[rclass]) + /* For the above condition the cost can be wrong. Use the allocno + class in this case. */ + rclass = ALLOCNO_CLASS (allocno); for (cp = ALLOCNO_COPIES (allocno); cp != NULL; cp = next_cp) { if (cp->first == allocno) @@ -2754,7 +2760,7 @@ allocno_copy_cost_saving (ira_allocno_t allocno, int hard_regno) } else gcc_unreachable (); - cost += cp->freq * ira_register_move_cost[ALLOCNO_MODE (allocno)][rclass][rclass]; + cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass]; } return cost; } |