Commit 095c3bbd by Jeff Law Committed by Jeff Law

flow.c (count_or_remove_death_notes_bb): New.

        * flow.c (count_or_remove_death_notes_bb): New.  Extracted from
        count_or_remove_death_notes.
        (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP.

From-SVN: r74111
parent 8325a4ec
2003-12-01 Jeff Law <law@redhat.com>
* flow.c (count_or_remove_death_notes_bb): New. Extracted from
count_or_remove_death_notes.
(count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP.
2003-12-01 Andreas Krebbel <krebbel1@de.ibm.com> 2003-12-01 Andreas Krebbel <krebbel1@de.ibm.com>
* builtins.c (expand_builtin_longjmp): Added two memory clobbers. * builtins.c (expand_builtin_longjmp): Added two memory clobbers.
......
...@@ -326,6 +326,7 @@ static void add_to_mem_set_list (struct propagate_block_info *, rtx); ...@@ -326,6 +326,7 @@ static void add_to_mem_set_list (struct propagate_block_info *, rtx);
static int invalidate_mems_from_autoinc (rtx *, void *); static int invalidate_mems_from_autoinc (rtx *, void *);
static void invalidate_mems_from_set (struct propagate_block_info *, rtx); static void invalidate_mems_from_set (struct propagate_block_info *, rtx);
static void clear_log_links (sbitmap); static void clear_log_links (sbitmap);
static int count_or_remove_death_notes_bb (basic_block, int);
void void
...@@ -4168,14 +4169,43 @@ int ...@@ -4168,14 +4169,43 @@ int
count_or_remove_death_notes (sbitmap blocks, int kill) count_or_remove_death_notes (sbitmap blocks, int kill)
{ {
int count = 0; int count = 0;
int i;
basic_block bb; basic_block bb;
FOR_EACH_BB_REVERSE (bb)
/* This used to be a loop over all the blocks with a membership test
inside the loop. That can be amazingly expensive on a large CFG
when only a small number of bits are set in BLOCKs (for example,
the calls from the scheduler typically have very few bits set).
For extra credit, someone should convert BLOCKS to a bitmap rather
than an sbitmap. */
if (blocks)
{ {
rtx insn; EXECUTE_IF_SET_IN_SBITMAP (blocks, 0, i,
{
count += count_or_remove_death_notes_bb (BASIC_BLOCK (i), kill);
});
}
else
{
FOR_EACH_BB (bb)
{
count += count_or_remove_death_notes_bb (bb, kill);
}
}
if (blocks && ! TEST_BIT (blocks, bb->index)) return count;
continue; }
/* Optionally removes all the REG_DEAD and REG_UNUSED notes from basic
block BB. Returns a count of the number of registers that died. */
static int
count_or_remove_death_notes_bb (basic_block bb, int kill)
{
int count = 0;
rtx insn;
for (insn = bb->head;; insn = NEXT_INSN (insn)) for (insn = bb->head;; insn = NEXT_INSN (insn))
{ {
...@@ -4200,6 +4230,7 @@ count_or_remove_death_notes (sbitmap blocks, int kill) ...@@ -4200,6 +4230,7 @@ count_or_remove_death_notes (sbitmap blocks, int kill)
n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)); n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
count += n; count += n;
} }
/* Fall through. */ /* Fall through. */
case REG_UNUSED: case REG_UNUSED:
...@@ -4223,10 +4254,10 @@ count_or_remove_death_notes (sbitmap blocks, int kill) ...@@ -4223,10 +4254,10 @@ count_or_remove_death_notes (sbitmap blocks, int kill)
if (insn == bb->end) if (insn == bb->end)
break; break;
} }
}
return count; return count;
} }
/* Clear LOG_LINKS fields of insns in a selected blocks or whole chain /* Clear LOG_LINKS fields of insns in a selected blocks or whole chain
if blocks is NULL. */ if blocks is NULL. */
......
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