From 93c20de2f05bf5b5984fa04736756ae87c2e5a12 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 23 May 2024 09:40:35 +0300 Subject: [PATCH] Update IR IR commit: e87914bda3939072bf1e470e923599d73063d9f1 --- ext/opcache/jit/ir/ir_gcm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ext/opcache/jit/ir/ir_gcm.c b/ext/opcache/jit/ir/ir_gcm.c index f74227e2c02..0dbde2fecec 100644 --- a/ext/opcache/jit/ir/ir_gcm.c +++ b/ext/opcache/jit/ir/ir_gcm.c @@ -455,6 +455,20 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b) } #endif +#ifdef IR_DEBUG +static bool ir_gcm_dominates(ir_ctx *ctx, uint32_t b1, uint32_t b2) +{ + uint32_t b1_depth = ctx->cfg_blocks[b1].dom_depth; + const ir_block *bb2 = &ctx->cfg_blocks[b2]; + + while (bb2->dom_depth > b1_depth) { + b2 = bb2->dom_parent; + bb2 = &ctx->cfg_blocks[b2]; + } + return b1 == b2; +} +#endif + static void ir_gcm_schedule_late(ir_ctx *ctx, ir_ref ref, uint32_t b) { ir_ref n, use; @@ -494,6 +508,7 @@ static void ir_gcm_schedule_late(ir_ctx *ctx, ir_ref ref, uint32_t b) } IR_ASSERT(lca != 0 && "No Common Ancestor"); + IR_ASSERT(ir_gcm_dominates(ctx, ctx->cfg_map[ref], lca) && "Early placement doesn't dominate the late"); #if IR_GCM_SPLIT if (ctx->use_lists[ref].count > 1