From ad31105fbaaedc323317bc1417e9a587b45a2916 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 6 Aug 2025 22:32:48 -0700 Subject: [PATCH 1/2] brw/scoreboard: Use a predicate helper for the nomask workaround If it wasn't for the workaround, it wouldn't be necessary to track the whether instructions are exec_all or not. The workaround affects results when mixing a dep and inst with different exec_all. Add the predicate so that, when the workaround is disabled, none of the effects of having different exec_all will kick in, all them will be considered `exec_all = true`. This patch don't change any behavior, just adds the predicate. Reviewed-by: Francisco Jerez --- .../compiler/brw/brw_lower_scoreboard.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw/brw_lower_scoreboard.cpp b/src/intel/compiler/brw/brw_lower_scoreboard.cpp index f5a933603d8..a58f38c189c 100644 --- a/src/intel/compiler/brw/brw_lower_scoreboard.cpp +++ b/src/intel/compiler/brw/brw_lower_scoreboard.cpp @@ -854,6 +854,16 @@ namespace { unsigned n; }; + /** + * Whether it is needed to apply workaround to avoid + * data coherency issues due to Wa_1407528679. + */ + bool + needs_nomask_workaround(const intel_device_info *devinfo) + { + return true; + } + /** * Add dependency \p dep to the list of dependencies of an instruction * \p deps. @@ -983,7 +993,8 @@ namespace { const dependency_list &deps, const ordered_address &jp) { - const bool exec_all = inst->force_writemask_all; + const bool exec_all = inst->force_writemask_all || + !needs_nomask_workaround(devinfo); const bool has_ordered = find_ordered_dependency(deps, jp, exec_all); const tgl_pipe ordered_pipe = ordered_dependency_swsb(deps, jp, exec_all).pipe; @@ -1224,7 +1235,8 @@ namespace { unsigned ip = 0; foreach_block_and_inst(block, brw_inst, inst, shader->cfg) { - const bool exec_all = inst->force_writemask_all; + const bool exec_all = inst->force_writemask_all || + !needs_nomask_workaround(devinfo); const tgl_pipe p = inferred_exec_pipe(devinfo, inst); scoreboard &sb = sbs[block->num]; @@ -1377,7 +1389,8 @@ namespace { unsigned ip = 0; foreach_block_and_inst_safe(block, brw_inst, inst, shader->cfg) { - const bool exec_all = inst->force_writemask_all; + const bool exec_all = inst->force_writemask_all || + !needs_nomask_workaround(devinfo); const bool ordered_mode = baked_ordered_dependency_mode(devinfo, inst, deps[ip], jps[ip]); const tgl_sbid_mode unordered_mode = From c534b38f0216c05b700c10d43f8b43f66f24f64a Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 6 Aug 2025 22:51:58 -0700 Subject: [PATCH 2/2] brw/scoreboard: Disable nomask workaround for Xe2+ The issue was caused by fused EU feature that is not used in Xe2+ anymore. Reviewed-by: Francisco Jerez --- src/intel/compiler/brw/brw_lower_scoreboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw/brw_lower_scoreboard.cpp b/src/intel/compiler/brw/brw_lower_scoreboard.cpp index a58f38c189c..a1613361fc2 100644 --- a/src/intel/compiler/brw/brw_lower_scoreboard.cpp +++ b/src/intel/compiler/brw/brw_lower_scoreboard.cpp @@ -861,7 +861,7 @@ namespace { bool needs_nomask_workaround(const intel_device_info *devinfo) { - return true; + return devinfo->ver < 20; } /**