From 5936768ce0b862b39322a6917da2f59477e3bdbe Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 27 Mar 2025 22:46:11 -0700 Subject: [PATCH] brw: Consider bfloat16 in copy propagation Reviewed-by: Rohan Garg Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_opt_copy_propagation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/compiler/brw_opt_copy_propagation.cpp b/src/intel/compiler/brw_opt_copy_propagation.cpp index 34cba38115f..b37798f78ba 100644 --- a/src/intel/compiler/brw_opt_copy_propagation.cpp +++ b/src/intel/compiler/brw_opt_copy_propagation.cpp @@ -793,6 +793,12 @@ try_copy_propagate(brw_shader &s, brw_inst *inst, (reg_offset(inst->dst) % (REG_SIZE * reg_unit(devinfo))) != (reg_offset(entry->src) % (REG_SIZE * reg_unit(devinfo)))) return false; + /* BFloat16 sources always must be packed and not scalars, + * so don't propagate those cases. + */ + if (brw_type_is_bfloat(inst->src[arg].type) && entry_stride != 1) + return false; + /* * Bail if the composition of both regions would be affected by the Xe2+ * regioning restrictions that apply to integer types smaller than a dword. @@ -1740,6 +1746,12 @@ try_copy_propagate_def(brw_shader &s, (reg_offset(inst->dst) % (REG_SIZE * reg_unit(devinfo))) != (reg_offset(val) % (REG_SIZE * reg_unit(devinfo)))) return false; + /* BFloat16 sources always must be packed and not scalars, + * so don't propagate those cases. + */ + if (brw_type_is_bfloat(inst->src[arg].type) && entry_stride != 1) + return false; + /* The <8;8,0> regions used for FS attributes in multipolygon * dispatch mode could violate regioning restrictions, don't copy * propagate them in such cases.