Skip to content

Commit

Permalink
Fix IR recostruction
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Mar 18, 2024
1 parent 2038027 commit 84df6f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ir_sccp.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ static void ir_sccp_remove_unfeasible_merge_inputs(ir_ctx *ctx, ir_insn *_values
}
}
j = i;
while (j < n) {
while (j <= n) {
ir_insn_set_op(insn, j, IR_UNUSED);
j++;
}
Expand Down Expand Up @@ -1258,11 +1258,13 @@ int ir_sccp(ir_ctx *ctx)
if (insn->type == IR_FLOAT) {
if (ir_may_promote_d2f(ctx, insn->op1)) {
ir_ref ref = ir_promote_d2f(ctx, insn->op1, i);
insn->op1 = ref;
ir_sccp_replace_insn2(ctx, i, ref, &worklist2);
}
} else {
if (ir_may_promote_f2d(ctx, insn->op1)) {
ir_ref ref = ir_promote_f2d(ctx, insn->op1, i);
insn->op1 = ref;
ir_sccp_replace_insn2(ctx, i, ref, &worklist2);
}
}
Expand All @@ -1281,6 +1283,7 @@ int ir_sccp(ir_ctx *ctx)
case IR_TRUNC:
if (ir_may_promote_i2i(ctx, insn->type, insn->op1)) {
ir_ref ref = ir_promote_i2i(ctx, insn->type, insn->op1, i);
insn->op1 = ref;
ir_sccp_replace_insn2(ctx, i, ref, &worklist2);
}
break;
Expand Down

0 comments on commit 84df6f8

Please sign in to comment.