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 <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24282>
This commit is contained in:
Lionel Landwerlin
2023-07-23 18:20:23 +03:00
committed by Marge Bot
parent 08bfcc12d4
commit 5c72724819

View File

@@ -658,6 +658,17 @@ fs_inst::is_partial_write() const
if (this->opcode == SHADER_OPCODE_SEND) if (this->opcode == SHADER_OPCODE_SEND)
return false; 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 || return this->exec_size * type_sz(this->dst.type) < 32 ||
!this->dst.is_contiguous(); !this->dst.is_contiguous();
} }