From 82fbe54e665595e155c8d7560f8fab23c7547f35 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 9 Feb 2026 18:53:03 -0500 Subject: [PATCH] brw: drop buggy SLM optimization This was incorrect for OpenCL due to the possibility of variable shared memory existing despite shared_size == 0. Fortunately the optimization it was trying to do should be done in NIR via nir_opt_barrier_modes so we can just drop the brw code and move on with our merry lives. Fixes OpenCL tests on Iris: non_uniform_work_group non_uniform_3d_barriers basic async_strided_copy_local_to_global Cc: mesa-stable Signed-off-by: Alyssa Rosenzweig Reviewed-by: Kenneth Graunke (cherry picked from commit bd5ebbb2f8bcfcd178d8bc62a55ab97abb57e140) Part-of: --- .pick_status.json | 2 +- src/intel/compiler/brw/brw_from_nir.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d9d6b809f9b..e5272e82251 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1484,7 +1484,7 @@ "description": "brw: drop buggy SLM optimization", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/compiler/brw/brw_from_nir.cpp b/src/intel/compiler/brw/brw_from_nir.cpp index d402460f976..8c0cd168f95 100644 --- a/src/intel/compiler/brw/brw_from_nir.cpp +++ b/src/intel/compiler/brw/brw_from_nir.cpp @@ -6033,12 +6033,6 @@ brw_from_nir_emit_intrinsic(nir_to_brw_state &ntb, if (opcode == BRW_OPCODE_NOP) break; - if (s.nir->info.shared_size > 0) { - assert(mesa_shader_stage_uses_workgroup(s.stage)); - } else { - slm_fence = false; - } - /* If the workgroup fits in a single HW thread, the messages for SLM are * processed in-order and the shader itself is already synchronized so * the memory fence is not necessary.