Commit 88312d26 by Kazu Hirata Committed by Kazu Hirata

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
parent fca01525
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
and 1. and 1.
(find_taken_edge_switch_expr): Remove a check for INTEGER_CST. (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> 2005-02-21 Jeff Law <law@redhat.com>
* cfganal.c (find_unreachable_blocks): Manually CSE load of * cfganal.c (find_unreachable_blocks): Manually CSE load of
......
...@@ -817,21 +817,35 @@ delete_noop_moves (void) ...@@ -817,21 +817,35 @@ delete_noop_moves (void)
void void
delete_dead_jumptables (void) delete_dead_jumptables (void)
{ {
rtx insn, next; basic_block bb;
for (insn = get_insns (); insn; insn = next)
/* 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); rtx insn, next;
if (LABEL_P (insn)
&& LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn) for (insn = NEXT_INSN (BB_END (bb));
&& JUMP_P (next) insn && !NOTE_INSN_BASIC_BLOCK_P (insn);
&& (GET_CODE (PATTERN (next)) == ADDR_VEC insn = next)
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
{ {
if (dump_file) next = NEXT_INSN (insn);
fprintf (dump_file, "Dead jumptable %i removed\n", INSN_UID (insn)); if (LABEL_P (insn)
delete_insn (NEXT_INSN (insn)); && LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
delete_insn (insn); && JUMP_P (next)
next = NEXT_INSN (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);
}
} }
} }
} }
......
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