On 05/18/2015 12:27 PM, Richard Sandiford wrote:
After the previous changes, several callers are left with code like:

   if (HARD_REGISTER_P (x))
     bitmap_foo_range (x, REGNO (x), REG_NREGS (x));
   else
     bitmap_foo (x, REGNO (x));

These might as well now be:

   if (REG_NREGS (x) > 1)
     bitmap_foo_range (x, REGNO (x), REG_NREGS (x));
   else
     bitmap_foo (x, REGNO (x));

since REG_NREGS is as cheap to test, and since single-register hard REGs
are the common case.  But if separating out the cases is a win -- and it
seems to be, very slightly -- then it would be better to add the shortcut
to the range functions themselves.


gcc/
        * bitmap.c (bitmap_set_range): Handle count==1 specially.
        (bitmap_clear_range): Likewise.
        * cfgcleanup.c (mark_effect): Use bitmap_clear_range and
        bitmap_set_range unconditionally.
        * df-problems.c (df_simulate_one_insn_forwards): Likewise.
        * df-scan.c (df_mark_reg): Likewise.
        * haifa-sched.c (setup_ref_regs): Likewise.
        * sched-rgn.c (update_live_1): Likewise.
OK.
jeff

Reply via email to