From 865daeb9889dfe6755b743357257757e6b3e255a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 29 Jun 2023 00:29:18 +0300 Subject: [PATCH] Duxed support for multi-word instructions --- ir_ra.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ir_ra.c b/ir_ra.c index 83b883b..a3df199 100644 --- a/ir_ra.c +++ b/ir_ra.c @@ -2214,7 +2214,15 @@ static ir_block *ir_block_from_live_pos(ir_ctx *ctx, ir_live_pos pos) IR_ASSERT(0); return NULL; #else - return &ctx->cfg_blocks[ctx->cfg_map[ref]]; + uint32_t b = ctx->cfg_map[ref]; + + while (!b) { + ref--; + IR_ASSERT(ref > 0); + b = ctx->cfg_map[ref]; + } + IR_ASSERT(b <= ctx->cfg_blocks_count); + return &ctx->cfg_blocks[b]; #endif }