summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2022-09-27 15:28:48 -0700
committerMarge Bot <emma+marge@anholt.net>2023-01-25 22:22:12 +0000
commit7b5e9336298b00eeffeec738adbcc0acc7683868 (patch)
treeb233c495d93756594671be4430bd5a3da6970199
parent51b8abe0ba5ea2cf0ba882faa7e3e36c273db4c5 (diff)
intel/fs: Fix src and dst types of LOAD_PAYLOAD ACP entries during copy propagation.
The ACP entries created by copy propagation to track the implied copies of LOAD_PAYLOAD instructions don't model the behavior of LOAD_PAYLOAD correctly, since (as of 41868bb6824c6106a55c844) header moves are implicitly retyped to UD and the destination of non-header copies implicitly uses the same type as the corresponding source, even though the ACP entries created for such copies could incorrectly represent a type conversion, which can lead to mis-optimization of the program. According to Marcin, this fixes the func.mesh.ext.workgroup_id.task.q0 crucible test. Fixes: 41868bb6824c6106a55c844 ("i965/fs: Rework the fs_visitor LOAD_PAYLOAD instruction") Reported-by: Marcin Ślusarz <marcin.slusarz@intel.com> Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18980>
-rw-r--r--src/intel/compiler/brw_fs_copy_propagation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp
index b4b48684898..69ceeb9bbc4 100644
--- a/src/intel/compiler/brw_fs_copy_propagation.cpp
+++ b/src/intel/compiler/brw_fs_copy_propagation.cpp
@@ -1108,9 +1108,11 @@ fs_visitor::opt_copy_propagation_local(void *copy_prop_ctx, bblock_t *block,
if (inst->src[i].file == VGRF ||
(inst->src[i].file == FIXED_GRF &&
inst->src[i].is_contiguous())) {
+ const brw_reg_type t = i < inst->header_size ?
+ BRW_REGISTER_TYPE_UD : inst->src[i].type;
acp_entry *entry = rzalloc(copy_prop_ctx, acp_entry);
- entry->dst = byte_offset(inst->dst, offset);
- entry->src = inst->src[i];
+ entry->dst = byte_offset(retype(inst->dst, t), offset);
+ entry->src = retype(inst->src[i], t);
entry->size_written = size_written;
entry->size_read = inst->size_read(i);
entry->opcode = inst->opcode;