From 09ea8409870910b7f08000c4bf9081b939cd1d72 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 7 Dec 2023 20:00:31 -0800 Subject: [PATCH] intel/fs: No need to copy null destinations in lower_simd_width. The copy would be discarded immediately. Until now we were relying on DCE to eliminate these, but it seems like in some cases MOVs into the null register emitted by lower_simd_width() are never eliminated, likely because a lower_simd_width() call has been introduced close to the bottom of optimize() which isn't follow by any additional DCE passes. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_fs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 46c51318165..e83267187a4 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -5238,6 +5238,9 @@ emit_unzip(const fs_builder &lbld, fs_inst *inst, unsigned i) static inline bool needs_dst_copy(const fs_builder &lbld, const fs_inst *inst) { + if (inst->dst.is_null()) + return false; + /* If the instruction writes more than one component we'll have to shuffle * the results of multiple lowered instructions in order to make sure that * they end up arranged correctly in the original destination region.