From 5c727248197c8a6c42a3b427320060c82303a944 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 23 Jul 2023 18:20:23 +0300 Subject: [PATCH] intel/fs: consider UNDEF as non-partial write A few titles show max live register reductions, but nothing significant in instruction count or other stats. Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Reviewed-by: Francisco Jerez Part-of: --- src/intel/compiler/brw_fs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 6e100367997..b8217b714ff 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -658,6 +658,17 @@ fs_inst::is_partial_write() const if (this->opcode == SHADER_OPCODE_SEND) return false; + /* Special case UNDEF since a lot of places in the backend do things like this : + * + * fs_builder ubld = bld.exec_all().group(1, 0); + * fs_reg tmp = ubld.vgrf(BRW_REGISTER_TYPE_UD); + * ubld.UNDEF(tmp); <- partial write, even if the whole register is concerned + */ + if (this->opcode == SHADER_OPCODE_UNDEF) { + assert(this->dst.is_contiguous()); + return this->size_written < 32; + } + return this->exec_size * type_sz(this->dst.type) < 32 || !this->dst.is_contiguous(); }