From 9c4cabd19d7815941b139e98a261fbf8a3e4f7b3 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 13 Oct 2023 13:57:48 +0300 Subject: [PATCH] Fix inerval flags reseting after coalescing --- ir_ra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ir_ra.c b/ir_ra.c index 661d22f..598d8e6 100644 --- a/ir_ra.c +++ b/ir_ra.c @@ -1587,7 +1587,9 @@ static void ir_vregs_join(ir_ctx *ctx, uint32_t r1, uint32_t r2) ctx->live_intervals[r1]->flags |= IR_LIVE_INTERVAL_COALESCED | (ival->flags & (IR_LIVE_INTERVAL_HAS_HINT_REGS|IR_LIVE_INTERVAL_HAS_HINT_REFS)); - ctx->live_intervals[r1]->flags &= ~(IR_LIVE_INTERVAL_MEM_PARAM|IR_LIVE_INTERVAL_MEM_LOAD); + if (ctx->ir_base[IR_LIVE_POS_TO_REF(ctx->live_intervals[r1]->use_pos->pos)].op != IR_VLOAD) { + ctx->live_intervals[r1]->flags &= ~IR_LIVE_INTERVAL_MEM_LOAD; + } ctx->live_intervals[r2] = NULL; // TODO: remember to reuse ???