On 05/30/2012 02:15 PM, Richard Sandiford wrote:
For one of the later patches I wanted to test whether a class had any
allocatable registers.  It turns out that we have two arrays that hold
the number of allocatable registers in a class:

     ira_class_hard_regs_num
     ira_available_class_regs
When IRA was being developed, ira_available_class was added first. It was enough for that time. In some time I needed ira_class_hard_regs_num. I should have removed ira_available_class_regs.
We calculate them in quick succession and already assert that they're
the same:

       COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
       AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
       ...
       for (n = 0, i = 0; i<  FIRST_PSEUDO_REGISTER; i++)
        if (TEST_HARD_REG_BIT (temp_hard_regset, i))
          ira_non_ordered_class_hard_regs[cl][n++] = i;
       ira_assert (ira_class_hard_regs_num[cl] == n);

       ...

       COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[i]);
       AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
       for (j = 0; j<  FIRST_PSEUDO_REGISTER; j++)
        if (TEST_HARD_REG_BIT (temp_hard_regset, j))
          ira_available_class_regs[i]++;

so this patch removes the latter in favour of the former.

Ok.  Thanks, Richard.

Reply via email to