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; }