Skip to content

Commit 0bf574a

Browse files
committed
Update IR
IR commit: 709ccf854ec708c36c0dd2a77996554f13e722f3 Fixes failures in function JIT introduced in d2b54dc
1 parent d2b54dc commit 0bf574a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ext/opcache/jit/ir/ir_cfg.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,6 @@ int ir_build_dominators_tree(ir_ctx *ctx)
15451545
/* In rare cases, LOOP_BEGIN.op1 may be a back-edge. Skip back-edges. */
15461546
ctx->flags2 &= ~IR_NO_LOOPS;
15471547
IR_ASSERT(k > 1);
1548-
IR_ASSERT(blocks[idom].successors_count == 1);
15491548
ir_list_push(&worklist, idom);
15501549
while (1) {
15511550
k--;
@@ -1555,7 +1554,6 @@ int ir_build_dominators_tree(ir_ctx *ctx)
15551554
break;
15561555
}
15571556
IR_ASSERT(k > 0);
1558-
IR_ASSERT(blocks[idom].successors_count == 1);
15591557
ir_list_push(&worklist, idom);
15601558
}
15611559
}
@@ -1578,7 +1576,6 @@ int ir_build_dominators_tree(ir_ctx *ctx)
15781576
} else {
15791577
ctx->flags2 &= ~IR_NO_LOOPS;
15801578
IR_ASSERT(bb->predecessors_count > 1);
1581-
IR_ASSERT(blocks[pred_b].successors_count == 1);
15821579
ir_list_push(&worklist, pred_b);
15831580
}
15841581
}
@@ -1616,8 +1613,16 @@ int ir_build_dominators_tree(ir_ctx *ctx)
16161613
do {
16171614
b = ir_list_pop(&worklist);
16181615
bb = &blocks[b];
1619-
IR_ASSERT(bb->successors_count == 1);
16201616
succ_b = ctx->cfg_edges[bb->successors];
1617+
if (bb->successors_count != 1) {
1618+
/* LOOP_END/END may be linked with the following ENTRY by a fake edge */
1619+
IR_ASSERT(bb->successors_count == 2);
1620+
if (blocks[succ_b].flags & IR_BB_ENTRY) {
1621+
succ_b = ctx->cfg_edges[bb->successors + 1];
1622+
} else {
1623+
IR_ASSERT(blocks[ctx->cfg_edges[bb->successors + 1]].flags & IR_BB_ENTRY);
1624+
}
1625+
}
16211626
dom_depth = blocks[succ_b].dom_depth;;
16221627
while (bb->dom_depth > dom_depth) {
16231628
b = bb->dom_parent;

0 commit comments

Comments
 (0)