From a259f645953c0a9f445414085a17ec63c015baa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 10 Oct 2025 13:12:01 -0700 Subject: [PATCH] intel/brw: Call lower_hdc_memory_fence_and_interlock() with brw_send_inst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With that we can avoid some as_send() calls. Fixes: 0fcce2722f20 ("brw: Add brw_send_inst") Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/compiler/brw/brw_lower_logical_sends.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/intel/compiler/brw/brw_lower_logical_sends.cpp b/src/intel/compiler/brw/brw_lower_logical_sends.cpp index ca1e4f39973..6324bc7d485 100644 --- a/src/intel/compiler/brw/brw_lower_logical_sends.cpp +++ b/src/intel/compiler/brw/brw_lower_logical_sends.cpp @@ -2535,7 +2535,7 @@ lower_lsc_memory_fence_and_interlock(const brw_builder &bld, struct brw_send_ins } static void -lower_hdc_memory_fence_and_interlock(const brw_builder &bld, brw_inst *inst) +lower_hdc_memory_fence_and_interlock(const brw_builder &bld, brw_send_inst *inst) { const intel_device_info *devinfo = bld.shader->devinfo; const bool interlock = inst->opcode == SHADER_OPCODE_INTERLOCK; @@ -2547,15 +2547,14 @@ lower_hdc_memory_fence_and_interlock(const brw_builder &bld, brw_inst *inst) bool slm = false; - assert(inst->as_send() != NULL); - if (inst->as_send()->sfid == BRW_SFID_SLM) { + if (inst->sfid == BRW_SFID_SLM) { assert(devinfo->ver >= 11); /* This SFID doesn't exist on Gfx11-12.0, but we use it to represent * SLM fences, and map back here to the way Gfx11 represented that: * a special "SLM" binding table index and the data cache SFID. */ - inst->as_send()->sfid = BRW_SFID_HDC0; + inst->sfid = BRW_SFID_HDC0; slm = true; } @@ -2669,7 +2668,7 @@ brw_lower_logical_sends(brw_shader &s) if (devinfo->has_lsc) lower_lsc_memory_fence_and_interlock(ibld, inst->as_send()); else - lower_hdc_memory_fence_and_interlock(ibld, inst); + lower_hdc_memory_fence_and_interlock(ibld, inst->as_send()); break; default: