Skip to content

Commit 93c20de

Browse files
committed
Update IR
IR commit: e87914bda3939072bf1e470e923599d73063d9f1
1 parent 8734a9a commit 93c20de

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ext/opcache/jit/ir/ir_gcm.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,20 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b)
455455
}
456456
#endif
457457

458+
#ifdef IR_DEBUG
459+
static bool ir_gcm_dominates(ir_ctx *ctx, uint32_t b1, uint32_t b2)
460+
{
461+
uint32_t b1_depth = ctx->cfg_blocks[b1].dom_depth;
462+
const ir_block *bb2 = &ctx->cfg_blocks[b2];
463+
464+
while (bb2->dom_depth > b1_depth) {
465+
b2 = bb2->dom_parent;
466+
bb2 = &ctx->cfg_blocks[b2];
467+
}
468+
return b1 == b2;
469+
}
470+
#endif
471+
458472
static void ir_gcm_schedule_late(ir_ctx *ctx, ir_ref ref, uint32_t b)
459473
{
460474
ir_ref n, use;
@@ -494,6 +508,7 @@ static void ir_gcm_schedule_late(ir_ctx *ctx, ir_ref ref, uint32_t b)
494508
}
495509

496510
IR_ASSERT(lca != 0 && "No Common Ancestor");
511+
IR_ASSERT(ir_gcm_dominates(ctx, ctx->cfg_map[ref], lca) && "Early placement doesn't dominate the late");
497512

498513
#if IR_GCM_SPLIT
499514
if (ctx->use_lists[ref].count > 1

0 commit comments

Comments
 (0)