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")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41263>
This commit is contained in:
Job Noorman 2026-04-29 15:28:48 +02:00 committed by Marge Bot
parent 5674327297
commit c50c06d83f

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