ir3/shared_ra: use ir3_cursor instead of instr in reload helpers

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
(cherry picked from commit c50c06d83f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41402>
This commit is contained in:
Job Noorman 2026-04-29 15:28:48 +02:00 committed by Eric Engestrom
parent 7d0df7a6e4
commit bb52bb165f
2 changed files with 7 additions and 7 deletions

View file

@ -444,7 +444,7 @@
"description": "ir3/shared_ra: use ir3_cursor instead of instr in reload helpers",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "fa22b0901af548d5e1433ad4cdbda314182137c5",
"notes": null

View file

@ -826,7 +826,7 @@ reload_interval(struct ra_ctx *ctx, struct ir3_cursor cursor,
}
static void
reload_src_finalize(struct ra_ctx *ctx, struct ir3_instruction *instr,
reload_src_finalize(struct ra_ctx *ctx, struct ir3_cursor reload_cursor,
struct ir3_register *src)
{
struct ir3_register *reg = src->def;
@ -835,7 +835,7 @@ reload_src_finalize(struct ra_ctx *ctx, struct ir3_instruction *instr,
if (!interval->needs_reload)
return;
reload_interval(ctx, ir3_before_instr(instr), interval);
reload_interval(ctx, reload_cursor, interval);
interval->needs_reload = false;
}
@ -1019,14 +1019,14 @@ handle_dst(struct ra_ctx *ctx, struct ir3_instruction *instr,
}
static void
handle_src_late(struct ra_ctx *ctx, struct ir3_instruction *instr,
handle_src_late(struct ra_ctx *ctx, struct ir3_cursor reload_cursor,
struct ir3_register *src)
{
if (!(src->flags & IR3_REG_SHARED))
return;
struct ra_interval *interval = ra_interval_get(ctx, src->def);
reload_src_finalize(ctx, instr, src);
reload_src_finalize(ctx, reload_cursor, src);
/* Remove killed sources that have to be killed late due to being merged with
* other defs.
@ -1054,7 +1054,7 @@ handle_normal_instr(struct ra_ctx *ctx, struct ir3_instruction *instr)
handle_dst(ctx, instr, dst);
ra_foreach_src (src, instr)
handle_src_late(ctx, instr, src);
handle_src_late(ctx, ir3_before_instr(instr), src);
}
static void
@ -1208,7 +1208,7 @@ handle_pcopy(struct ra_ctx *ctx, struct ir3_instruction *pcopy)
assign_src(ctx, src);
ra_foreach_src (src, pcopy)
handle_src_late(ctx, pcopy, src);
handle_src_late(ctx, ir3_before_instr(pcopy), src);
}
static void