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
This commit is contained in:
Vladimir Makarov 2016-03-31 17:51:13 +00:00 committed by Vladimir Makarov
parent 6f652a5072
commit c4b1942cb7
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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;
}