From 88d46605bd31a4e5e5ce388aa2dbf5e0a445ae39 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 9 Dec 2025 03:21:04 -0800 Subject: [PATCH] nir: Support Intel URB intrinsics in nir_opt_offsets We don't bother with maximums or wrapping because it shouldn't come up for IO intrinsics anyway. fossil-db results on Battlemage: Instrs: 231363032 -> 231359554 (-0.00%) Cycle count: 34057005552.0 -> 34057236190.0 (+0.00%); split: -0.00%, +0.00% Max live registers: 71873886 -> 71870438 (-0.00%) Non SSA regs after NIR: 67159408 -> 67159523 (+0.00%) Totals from 1779 (0.23% of 788851) affected shaders: Instrs: 774359 -> 770881 (-0.45%) Cycle count: 10551280.0 -> 10781918.0 (+2.19%); split: -0.32%, +2.51% Max live registers: 158193 -> 154745 (-2.18%) Non SSA regs after NIR: 180104 -> 180219 (+0.06%) Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_offsets.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/nir/nir_opt_offsets.c b/src/compiler/nir/nir_opt_offsets.c index 09f9139e908..bb2c5950808 100644 --- a/src/compiler/nir/nir_opt_offsets.c +++ b/src/compiler/nir/nir_opt_offsets.c @@ -291,6 +291,13 @@ process_instr(nir_builder *b, nir_instr *instr, void *s) return try_fold_load_store(b, intrin, state, 2, get_max(state, intrin, state->options->buffer_max), need_nuw); case nir_intrinsic_store_ssbo_ir3: return try_fold_load_store(b, intrin, state, 3, get_max(state, intrin, state->options->buffer_max), need_nuw); + case nir_intrinsic_load_urb_lsc_intel: + return try_fold_load_store(b, intrin, state, 0, UINT32_MAX, false); + case nir_intrinsic_store_urb_lsc_intel: + case nir_intrinsic_load_urb_vec4_intel: + return try_fold_load_store(b, intrin, state, 1, UINT32_MAX, false); + case nir_intrinsic_store_urb_vec4_intel: + return try_fold_load_store(b, intrin, state, 2, UINT32_MAX, false); default: return false; }