aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira-costs.c32
2 files changed, 33 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e467c0c..e0d22a8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 12d3ed6..dc983fd 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -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);