On 05/30/2012 02:28 PM, Richard Sandiford wrote:
I needed to move an instance of:

       COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
       AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
       if (hard_reg_set_empty_p (temp_hard_regset))
        continue;

But this can more easily be calculated as:

       ira_class_hard_regs_num[cl] == 0

so this patch uses that instead.

Richard


gcc/
        * ira.c (setup_allocno_and_important_classes): Use
        ira_class_hard_regs_num to check whether a class has any
        allocatable registers.
        (ira_init_register_move_cost): Likewise.


Ok.  The code looks more clear and compact.

Reply via email to