Commit 07a737f3 by Richard Sandiford Committed by Richard Sandiford

bitmap.c (bitmap_set_range): Handle count==1 specially.

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.

From-SVN: r223344
parent 72d19505
2015-05-19 Richard Sandiford <richard.sandiford@arm.com> 2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
* 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.
2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
* regs.h (END_HARD_REGNO): Delete. * regs.h (END_HARD_REGNO): Delete.
(END_REGNO): Move to... (END_REGNO): Move to...
* rtl.h: ...here. * rtl.h: ...here.
......
...@@ -1212,6 +1212,12 @@ bitmap_set_range (bitmap head, unsigned int start, unsigned int count) ...@@ -1212,6 +1212,12 @@ bitmap_set_range (bitmap head, unsigned int start, unsigned int count)
if (!count) if (!count)
return; return;
if (count == 1)
{
bitmap_set_bit (head, start);
return;
}
first_index = start / BITMAP_ELEMENT_ALL_BITS; first_index = start / BITMAP_ELEMENT_ALL_BITS;
end_bit_plus1 = start + count; end_bit_plus1 = start + count;
last_index = (end_bit_plus1 - 1) / BITMAP_ELEMENT_ALL_BITS; last_index = (end_bit_plus1 - 1) / BITMAP_ELEMENT_ALL_BITS;
...@@ -1311,6 +1317,12 @@ bitmap_clear_range (bitmap head, unsigned int start, unsigned int count) ...@@ -1311,6 +1317,12 @@ bitmap_clear_range (bitmap head, unsigned int start, unsigned int count)
if (!count) if (!count)
return; return;
if (count == 1)
{
bitmap_clear_bit (head, start);
return;
}
first_index = start / BITMAP_ELEMENT_ALL_BITS; first_index = start / BITMAP_ELEMENT_ALL_BITS;
end_bit_plus1 = start + count; end_bit_plus1 = start + count;
last_index = (end_bit_plus1 - 1) / BITMAP_ELEMENT_ALL_BITS; last_index = (end_bit_plus1 - 1) / BITMAP_ELEMENT_ALL_BITS;
......
...@@ -222,22 +222,15 @@ try_simplify_condjump (basic_block cbranch_block) ...@@ -222,22 +222,15 @@ try_simplify_condjump (basic_block cbranch_block)
static bool static bool
mark_effect (rtx exp, regset nonequal) mark_effect (rtx exp, regset nonequal)
{ {
int regno;
rtx dest; rtx dest;
switch (GET_CODE (exp)) switch (GET_CODE (exp))
{ {
/* In case we do clobber the register, mark it as equal, as we know the /* In case we do clobber the register, mark it as equal, as we know the
value is dead so it don't have to match. */ value is dead so it don't have to match. */
case CLOBBER: case CLOBBER:
if (REG_P (XEXP (exp, 0))) dest = XEXP (exp, 0);
{ if (REG_P (dest))
dest = XEXP (exp, 0); bitmap_clear_range (nonequal, REGNO (dest), REG_NREGS (dest));
regno = REGNO (dest);
if (HARD_REGISTER_NUM_P (regno))
bitmap_clear_range (nonequal, regno, REG_NREGS (dest));
else
bitmap_clear_bit (nonequal, regno);
}
return false; return false;
case SET: case SET:
...@@ -248,11 +241,7 @@ mark_effect (rtx exp, regset nonequal) ...@@ -248,11 +241,7 @@ mark_effect (rtx exp, regset nonequal)
return false; return false;
if (!REG_P (dest)) if (!REG_P (dest))
return true; return true;
regno = REGNO (dest); bitmap_set_range (nonequal, REGNO (dest), REG_NREGS (dest));
if (HARD_REGISTER_NUM_P (regno))
bitmap_set_range (nonequal, regno, REG_NREGS (dest));
else
bitmap_set_bit (nonequal, regno);
return false; return false;
default: default:
......
...@@ -3574,11 +3574,7 @@ df_simulate_one_insn_forwards (basic_block bb, rtx_insn *insn, bitmap live) ...@@ -3574,11 +3574,7 @@ df_simulate_one_insn_forwards (basic_block bb, rtx_insn *insn, bitmap live)
case REG_UNUSED: case REG_UNUSED:
{ {
rtx reg = XEXP (link, 0); rtx reg = XEXP (link, 0);
int regno = REGNO (reg); bitmap_clear_range (live, REGNO (reg), REG_NREGS (reg));
if (HARD_REGISTER_NUM_P (regno))
bitmap_clear_range (live, regno, REG_NREGS (reg));
else
bitmap_clear_bit (live, regno);
} }
break; break;
default: default:
......
...@@ -3518,15 +3518,7 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses) ...@@ -3518,15 +3518,7 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses)
static void static void
df_mark_reg (rtx reg, void *vset) df_mark_reg (rtx reg, void *vset)
{ {
bitmap set = (bitmap) vset; bitmap_set_range ((bitmap) vset, REGNO (reg), REG_NREGS (reg));
int regno = REGNO (reg);
gcc_assert (GET_MODE (reg) != BLKmode);
if (regno < FIRST_PSEUDO_REGISTER)
bitmap_set_range (set, regno, REG_NREGS (reg));
else
bitmap_set_bit (set, regno);
} }
......
...@@ -1032,17 +1032,13 @@ initiate_reg_pressure_info (bitmap live) ...@@ -1032,17 +1032,13 @@ initiate_reg_pressure_info (bitmap live)
static void static void
setup_ref_regs (rtx x) setup_ref_regs (rtx x)
{ {
int i, j, regno; int i, j;
const RTX_CODE code = GET_CODE (x); const RTX_CODE code = GET_CODE (x);
const char *fmt; const char *fmt;
if (REG_P (x)) if (REG_P (x))
{ {
regno = REGNO (x); bitmap_set_range (region_ref_regs, REGNO (x), REG_NREGS (x));
if (HARD_REGISTER_NUM_P (regno))
bitmap_set_range (region_ref_regs, regno, REG_NREGS (x));
else
bitmap_set_bit (region_ref_regs, REGNO (x));
return; return;
} }
fmt = GET_RTX_FORMAT (code); fmt = GET_RTX_FORMAT (code);
......
...@@ -1801,11 +1801,7 @@ update_live_1 (int src, rtx x) ...@@ -1801,11 +1801,7 @@ update_live_1 (int src, rtx x)
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];
bitmap_set_range (df_get_live_in (b), regno, REG_NREGS (reg));
if (HARD_REGISTER_NUM_P (regno))
bitmap_set_range (df_get_live_in (b), regno, REG_NREGS (reg));
else
bitmap_set_bit (df_get_live_in (b), regno);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment