Skip to content

Commit

Permalink
Remove dead (unused) PHIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Apr 25, 2024
1 parent dc1f63b commit 452b204
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ir_sccp.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static void ir_sccp_remove_unfeasible_merge_inputs(ir_ctx *ctx, ir_insn *_values
IR_ASSERT(!next);
next = use;
next_insn = use_insn;
} else {
} else if (use_insn->op != IR_NOP) {
IR_ASSERT(use_insn->op1 == ref);
use_insn->op1 = prev;
ir_use_list_add(ctx, prev, use);
Expand Down Expand Up @@ -1154,13 +1154,13 @@ int ir_sccp(ir_ctx *ctx)
insn = &ctx->ir_base[i];
flags = ir_op_flags[insn->op];
if (flags & IR_OP_FLAG_DATA) {
if (insn->op == IR_PHI) {
if (ctx->use_lists[i].count == 0) {
/* dead code */
continue;
} else if (insn->op == IR_PHI) {
if (!ir_sccp_meet_phi(ctx, _values, i, insn, &worklist)) {
continue;
}
} else if (ctx->use_lists[i].count == 0) {
/* dead code */
continue;
} else if (EXPECTED(IR_IS_FOLDABLE_OP(insn->op))) {
bool may_benefit = 0;
bool has_top = 0;
Expand Down

0 comments on commit 452b204

Please sign in to comment.