re PR rtl-optimization/49890 (IRA spill with plenty of available registers)

2011-08-18  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/49890
	* ira-costs.c (setup_regno_cost_classes_by_aclass): Don't exclude
	subclasses of class which is superset of a pressure class.

From-SVN: r177874
This commit is contained in:
Vladimir Makarov 2011-08-18 17:06:18 +00:00 committed by Vladimir Makarov
parent 079a5ca908
commit 6277a71071
2 changed files with 33 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2011-08-18 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/49890
* ira-costs.c (setup_regno_cost_classes_by_aclass): Don't exclude
subclasses of class which is superset of a pressure class.
2011-08-18 H.J. Lu <hongjiu.lu@intel.com>
Igor Zamyatin <igor.zamyatin@intel.com>

View File

@ -232,20 +232,42 @@ setup_regno_cost_classes_by_aclass (int regno, enum reg_class aclass)
int i;
PTR *slot;
HARD_REG_SET temp, temp2;
bool exclude_p;
if ((classes_ptr = cost_classes_aclass_cache[aclass]) == NULL)
{
COPY_HARD_REG_SET (temp, reg_class_contents[aclass]);
AND_COMPL_HARD_REG_SET (temp, ira_no_alloc_regs);
/* We exclude classes from consideration which are subsets of
ACLASS only if ACLASS is a pressure class or subset of a
pressure class. It means by the definition of pressure classes
that cost of moving between susbets of ACLASS is cheaper than
load or store. */
for (i = 0; i < ira_pressure_classes_num; i++)
{
cl = ira_pressure_classes[i];
if (cl == aclass)
break;
COPY_HARD_REG_SET (temp2, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp2, ira_no_alloc_regs);
if (hard_reg_set_subset_p (temp, temp2))
break;
}
exclude_p = i < ira_pressure_classes_num;
classes.num = 0;
for (i = 0; i < ira_important_classes_num; i++)
{
cl = ira_important_classes[i];
COPY_HARD_REG_SET (temp2, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp2, ira_no_alloc_regs);
if (! ira_reg_pressure_class_p[cl]
&& hard_reg_set_subset_p (temp2, temp) && cl != aclass)
continue;
if (exclude_p)
{
/* Exclude no-pressure classes which are subsets of
ACLASS. */
COPY_HARD_REG_SET (temp2, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp2, ira_no_alloc_regs);
if (! ira_reg_pressure_class_p[cl]
&& hard_reg_set_subset_p (temp2, temp) && cl != aclass)
continue;
}
classes.classes[classes.num++] = cl;
}
slot = htab_find_slot (cost_classes_htab, &classes, INSERT);