Update IR

IR commit: e87914bda3939072bf1e470e923599d73063d9f1
This commit is contained in:
Dmitry Stogov 2024-05-23 09:40:35 +03:00
parent 8734a9a4af
commit 93c20de2f0
No known key found for this signature in database

View file

@ -455,6 +455,20 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b)
} }
#endif #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) static void ir_gcm_schedule_late(ir_ctx *ctx, ir_ref ref, uint32_t b)
{ {
ir_ref n, use; 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(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 IR_GCM_SPLIT
if (ctx->use_lists[ref].count > 1 if (ctx->use_lists[ref].count > 1