Skip to content

Commit

Permalink
Elmiminate dead STORE
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Nov 14, 2024
1 parent 23c188c commit 9aa71a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,10 @@ void _ir_STORE(ir_ctx *ctx, ir_ref addr, ir_ref val)
}
} else if (insn->op == IR_LOAD) {
if (insn->op2 == addr) {
if (ref == val) {
/* dead STORE */
return;
}
break;
}
type2 = insn->type;
Expand Down

0 comments on commit 9aa71a1

Please sign in to comment.