From be4fa59a724fff6c94be66665d151b6462ecedb8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 25 Mar 2024 14:22:59 -0700 Subject: [PATCH] intel/brw: Clear write_accumulator flag when changing the destination If the destination was the accumulator but is no longer, having the flag set is not correct. On Xe2 this also causes a validation error. v2: Reword the comment to be more clear. Suggested by Jordan. Fixes: efa4e4bc5fc ("intel/fs: Introduce regioning lowering pass.") Reviewed-by: Jordan Justen Part-of: --- src/intel/compiler/brw_fs_lower_regioning.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/intel/compiler/brw_fs_lower_regioning.cpp b/src/intel/compiler/brw_fs_lower_regioning.cpp index cb125e197b5..4e01d80f8b7 100644 --- a/src/intel/compiler/brw_fs_lower_regioning.cpp +++ b/src/intel/compiler/brw_fs_lower_regioning.cpp @@ -550,6 +550,12 @@ namespace { ibld.at(block, inst->next).MOV(subscript(inst->dst, raw_type, j), subscript(tmp, raw_type, j)); + /* If the destination was an accumulator, after lowering it will be a + * GRF. Clear writes_accumulator for the instruction. + */ + if (inst->dst.is_accumulator()) + inst->writes_accumulator = false; + /* Point the original instruction at the temporary, making sure to keep * any destination modifiers in the instruction. */