nir/opt_offsets: add support for @load/store_global_ir3

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
This commit is contained in:
Job Noorman 2026-05-05 06:25:49 +02:00
parent c784af5ca0
commit 0703f27d6a
2 changed files with 7 additions and 0 deletions

View file

@ -6810,6 +6810,9 @@ typedef struct nir_opt_offsets_options {
/** nir_load/store_buffer_amd max base offset */
uint32_t buffer_max;
/** nir_load/store_global_offset max base offset */
uint32_t global_max;
/**
* Callback to get the max base offset for instructions for which the
* corresponding value above is zero.

View file

@ -387,6 +387,10 @@ process_instr(nir_builder *b, nir_instr *instr, void *s)
return try_fold_load_store(b, intrin, state, 0, 0, get_max(state, intrin, 0), false);
case nir_intrinsic_isbewr_nv:
return try_fold_load_store(b, intrin, state, 1, 0, get_max(state, intrin, 0), false);
case nir_intrinsic_load_global_ir3:
return try_fold_load_store(b, intrin, state, 1, 0, get_max(state, intrin, state->options->global_max), need_nuw);
case nir_intrinsic_store_global_ir3:
return try_fold_load_store(b, intrin, state, 2, 0, get_max(state, intrin, state->options->global_max), need_nuw);
default:
return false;
}