remove dead branch usage
Christopher Li
maintainerRFC PATCH 2/4 remove dead branch usage
Fix some problem cause by dead branch instruction left in the user chain.
Signed-off-by Christopher Li <[email protected]>
flow.c +1 -0
@@ -195,6 +195,7 @@ try_to_rewrite_target:if (bb_list_size (target->parents) !=1 )return retval;insert_branch (target, insn, final); +kill_instruction (insn);return 1 ; }
simplify.c +5 -0
@@ -217,6 +217,11 @@ void kill_instruction(struct instructionkill_use (&insn->src2);kill_use (&insn->src3);return ; +case OP_BR : + insn->bb =NULL ; + repeat_phase |=REPEAT_CSE ; +if (insn->cond) +kill_use (&insn->cond); } }