flow.c (delete_dead_jumptables): Speed up by scanning insns that do not belong to any basic block.

* flow.c (delete_dead_jumptables): Speed up by scanning insns
	that do not belong to any basic block.

From-SVN: r95342
This commit is contained in:
Kazu Hirata 2005-02-21 19:47:40 +00:00 committed by Kazu Hirata
parent fca01525bf
commit 88312d26a5
2 changed files with 30 additions and 13 deletions

View File

@ -7,6 +7,9 @@
and 1.
(find_taken_edge_switch_expr): Remove a check for INTEGER_CST.
* flow.c (delete_dead_jumptables): Speed up by scanning insns
that do not belong to any basic block.
2005-02-21 Jeff Law <law@redhat.com>
* cfganal.c (find_unreachable_blocks): Manually CSE load of

View File

@ -817,21 +817,35 @@ delete_noop_moves (void)
void
delete_dead_jumptables (void)
{
rtx insn, next;
for (insn = get_insns (); insn; insn = next)
basic_block bb;
/* A dead jump table does not belong to any basic block. Scan insns
between two adjacent basic blocks. */
FOR_EACH_BB (bb)
{
next = NEXT_INSN (insn);
if (LABEL_P (insn)
&& LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
&& JUMP_P (next)
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
rtx insn, next;
for (insn = NEXT_INSN (BB_END (bb));
insn && !NOTE_INSN_BASIC_BLOCK_P (insn);
insn = next)
{
if (dump_file)
fprintf (dump_file, "Dead jumptable %i removed\n", INSN_UID (insn));
delete_insn (NEXT_INSN (insn));
delete_insn (insn);
next = NEXT_INSN (next);
next = NEXT_INSN (insn);
if (LABEL_P (insn)
&& LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
&& JUMP_P (next)
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
{
rtx label = insn, jump = next;
if (dump_file)
fprintf (dump_file, "Dead jumptable %i removed\n",
INSN_UID (insn));
next = NEXT_INSN (next);
delete_insn (jump);
delete_insn (label);
}
}
}
}