From 609016296173e1d16435096ff1f5f2a41d12c4d3 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Thu, 27 Feb 2025 19:45:21 +0100 Subject: [PATCH] ir3/ra: prevent reusing parent interval of reloaded sources We would set the `src` flag on the interval of reloaded sources. However, the interval might be merged with its parent when inserted and the parent wouldn't have this flag set. This caused the parent interval to potentially be reused to reload later sources. Fix this by setting the `src` flag on the top-level interval after insertion. Signed-off-by: Job Noorman Fixes: fa22b0901af ("ir3/ra: Add specialized shared register RA/spilling") Part-of: (cherry picked from commit 2d540b80746bc20c1e5de94a6933837fc6cf0c64) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_shared_ra.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 87e61a2a972..24ba614d98c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -894,7 +894,7 @@ "description": "ir3/ra: prevent reusing parent interval of reloaded sources", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "fa22b0901af548d5e1433ad4cdbda314182137c5", "notes": null diff --git a/src/freedreno/ir3/ir3_shared_ra.c b/src/freedreno/ir3/ir3_shared_ra.c index bc890e0b63b..8bf9728b9ae 100644 --- a/src/freedreno/ir3/ir3_shared_ra.c +++ b/src/freedreno/ir3/ir3_shared_ra.c @@ -734,6 +734,10 @@ reload_src(struct ra_ctx *ctx, struct ir3_instruction *instr, interval->physreg_end = best_reg + size; interval->needs_reload = true; ir3_reg_interval_insert(&ctx->reg_ctx, &interval->interval); + + while (interval->interval.parent) + interval = ir3_reg_interval_to_ra_interval(interval->interval.parent); + interval->src = true; }