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 <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33810>
(cherry picked from commit 2d540b8074)
This commit is contained in:
Job Noorman 2025-02-27 19:45:21 +01:00 committed by Eric Engestrom
parent f912436dc9
commit 6090162961
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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;
}