Update usage chain for dead instruction
Christopher Li
maintainerPATCH 1/1 Update usage chain for dead instruction
This patch address some of the dead instruction
left in the usage 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); } }
Quoted 2 lines · Christopher Li
This patch address some of the dead instruction
left in the usage chain.
Merged.
One minor style note:
simplify.c void kill_instruction(struct instruction · line 226
Quoted 13 lines
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); } }
Despite redundancy, please include return or break statements in the last case of a switch, to make modifications less error-prone.
- Josh Triplett