diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-25 17:56:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:04:54 -0700 |
commit | 9eb3f1e8a155b769af96005dadc282b3cf401fba (patch) | |
tree | 4943f75a9b044ce1f1caf588e6c205388d3ad3bc /simplify.c | |
parent | Use cleaned-up ptr list removal for removing basic blocks (diff) | |
download | sparse-9eb3f1e8a155b769af96005dadc282b3cf401fba.tar.gz sparse-9eb3f1e8a155b769af96005dadc282b3cf401fba.tar.bz2 sparse-9eb3f1e8a155b769af96005dadc282b3cf401fba.zip |
Be more thorough about killing unreachable instructions.
We want to make sure that we kill them properly, so that
any pseudos they depended on or generated are also killed.
Diffstat (limited to 'simplify.c')
-rw-r--r-- | simplify.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -143,21 +143,21 @@ static int clean_up_phi(struct instruction *insn) return if_convert_phi(insn); } -static void try_to_kill(struct instruction *); - static void kill_use(pseudo_t pseudo) { if (pseudo->type == PSEUDO_REG) { if (ptr_list_size((struct ptr_list *)pseudo->users) == 1) { - try_to_kill(pseudo->def); + kill_instruction(pseudo->def); } } } -static void try_to_kill(struct instruction *insn) +void kill_instruction(struct instruction *insn) { - int opcode = insn->opcode; - switch (opcode) { + if (!insn->bb) + return; + + switch (insn->opcode) { case OP_BINARY ... OP_BINCMP_END: insn->bb = NULL; kill_use(insn->src1); |