ir3/legalize: run dbg nop/sync sched later
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Running nop sched before opt_jump runs into issues because at that
point, we might have branches like this:

getone x
jump y

which becomes this after nop sched:

(rpt5)nop
getone x
(rpt5)nop
jump y

and then opt_jump may remove the jump leaving the block without a
terminator. This in turn causes ir3_calc_reconvergence to calculate (jp)
incorrectly.

Sync sched is fine but let's keep the two together.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38833>
This commit is contained in:
Job Noorman 2025-12-05 17:01:21 +01:00 committed by Marge Bot
parent a4b6158260
commit a071e91725

View file

@ -2254,14 +2254,6 @@ ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary)
progress |= apply_fine_deriv_macro(ctx, block);
}
if (ir3_shader_debug & IR3_DBG_FULLSYNC) {
dbg_sync_sched(ir, so);
}
if (ir3_shader_debug & IR3_DBG_FULLNOP) {
dbg_nop_sched(ir, so);
}
bool cfg_changed = false;
while (opt_jump(ir))
cfg_changed = true;
@ -2279,6 +2271,14 @@ ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary)
so->compiler->gen >= 6)
helper_sched(ctx, ir, so);
if (ir3_shader_debug & IR3_DBG_FULLSYNC) {
dbg_sync_sched(ir, so);
}
if (ir3_shader_debug & IR3_DBG_FULLNOP) {
dbg_nop_sched(ir, so);
}
/* Note: insert (last) before alias.tex to have the sources that are actually
* read by instructions (as opposed to alias registers) more easily
* available.