From 0703f27d6a135689e8d5cf1c297bb094e3252fb3 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 5 May 2026 06:25:49 +0200 Subject: [PATCH] nir/opt_offsets: add support for @load/store_global_ir3 Signed-off-by: Job Noorman Part-of: --- src/compiler/nir/nir.h | 3 +++ src/compiler/nir/nir_opt_offsets.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index ad5f561394f..c3196899845 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -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. diff --git a/src/compiler/nir/nir_opt_offsets.c b/src/compiler/nir/nir_opt_offsets.c index 5e53ac297c2..1aebfdfc0e3 100644 --- a/src/compiler/nir/nir_opt_offsets.c +++ b/src/compiler/nir/nir_opt_offsets.c @@ -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; }