+2011-03-19 Anatoly Sokolov <aesok@post.ru>
+
+ * cfgcleanup.c (mark_effect): Use bitmap_set_range/bitmap_clear_range
+ instead of loop. Use HARD_REGISTER_NUM_P predicate.
+ * haifa-sched.c (setup_ref_regs): Ditto.
+ * caller-save.c (add_used_regs_1): Ditto.
+ * dse.c (look_for_hardregs): Ditto.
+ * df-problems.c (df_simulate_one_insn_forwards): Ditto.
+ * sched-rgn.c (check_live_1): Ditto.
+
2011-03-18 Joseph Myers <joseph@codesourcery.com>
* c-decl.c (diagnose_mismatched_decls): Give an error for
static int
add_used_regs_1 (rtx *loc, void *data)
{
- int regno, i;
+ unsigned int regno;
regset live;
rtx x;
if (REG_P (x))
{
regno = REGNO (x);
- if (!HARD_REGISTER_NUM_P (regno))
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]);
+ else
regno = reg_renumber[regno];
- if (regno >= 0)
- for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--)
- SET_REGNO_REG_SET (live, regno + i);
}
return 0;
}
/* Control flow optimization code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
{
dest = XEXP (exp, 0);
regno = REGNO (dest);
- CLEAR_REGNO_REG_SET (nonequal, regno);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int n = hard_regno_nregs[regno][GET_MODE (dest)];
- while (--n > 0)
- CLEAR_REGNO_REG_SET (nonequal, regno + n);
- }
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_clear_range (nonequal, regno,
+ hard_regno_nregs[regno][GET_MODE (dest)]);
+ else
+ bitmap_clear_bit (nonequal, regno);
}
return false;
if (!REG_P (dest))
return true;
regno = REGNO (dest);
- SET_REGNO_REG_SET (nonequal, regno);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int n = hard_regno_nregs[regno][GET_MODE (dest)];
- while (--n > 0)
- SET_REGNO_REG_SET (nonequal, regno + n);
- }
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_set_range (nonequal, regno,
+ hard_regno_nregs[regno][GET_MODE (dest)]);
+ else
+ bitmap_set_bit (nonequal, regno);
return false;
default:
/* Standard problems for dataflow support routines.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Originally contributed by Michael P. Hayes
(m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
{
rtx reg = XEXP (link, 0);
int regno = REGNO (reg);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int n = hard_regno_nregs[regno][GET_MODE (reg)];
- while (--n >= 0)
- bitmap_clear_bit (live, regno + n);
- }
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_clear_range (live, regno,
+ hard_regno_nregs[regno][GET_MODE (reg)]);
else
bitmap_clear_bit (live, regno);
}
bitmap regs_set = (bitmap) data;
if (REG_P (x)
- && REGNO (x) < FIRST_PSEUDO_REGISTER)
+ && HARD_REGISTER_P (x))
{
- int regno = REGNO (x);
- int n = hard_regno_nregs[regno][GET_MODE (x)];
- while (--n >= 0)
- bitmap_set_bit (regs_set, regno + n);
+ unsigned int regno = REGNO (x);
+ bitmap_set_range (regs_set, regno,
+ hard_regno_nregs[regno][GET_MODE (x)]);
}
}
/* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
if (REG_P (x))
{
regno = REGNO (x);
- if (regno >= FIRST_PSEUDO_REGISTER)
- bitmap_set_bit (region_ref_regs, REGNO (x));
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_set_range (region_ref_regs, regno,
+ hard_regno_nregs[regno][GET_MODE (x)]);
else
- for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--)
- bitmap_set_bit (region_ref_regs, regno + i);
+ bitmap_set_bit (region_ref_regs, REGNO (x));
return;
}
fmt = GET_RTX_FORMAT (code);
/* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
regno = REGNO (reg);
- if (regno >= FIRST_PSEUDO_REGISTER || !global_regs[regno])
+ if (! HARD_REGISTER_NUM_P (regno)
+ || !global_regs[regno])
{
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = hard_regno_nregs[regno][GET_MODE (reg)];
- while (--j >= 0)
- {
- for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
- {
- basic_block b = candidate_table[src].update_bbs.first_member[i];
-
- SET_REGNO_REG_SET (df_get_live_in (b), regno + j);
- }
- }
- }
- else
+ for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
{
- for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
- {
- basic_block b = candidate_table[src].update_bbs.first_member[i];
+ basic_block b = candidate_table[src].update_bbs.first_member[i];
- SET_REGNO_REG_SET (df_get_live_in (b), regno);
- }
+ if (HARD_REGISTER_NUM_P (regno))
+ bitmap_set_range (df_get_live_in (b), regno,
+ hard_regno_nregs[regno][GET_MODE (reg)]);
+ else
+ bitmap_set_bit (df_get_live_in (b), regno);
}
}
}