From c1cf40da8a59c29542ac1e7988b4579c4aa89d6c Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 3 May 2023 11:24:19 +0200 Subject: [PATCH] aco: Assert that operands have the same byte offset when reassigning split vectors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can not happen because the post-RA optimizer doesn't support sub dword writes at the moment, but everytime I look at this I wonder if there might be a bug here. Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_optimizer_postRA.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/compiler/aco_optimizer_postRA.cpp b/src/amd/compiler/aco_optimizer_postRA.cpp index a05f216c97f..b9dd52a87cb 100644 --- a/src/amd/compiler/aco_optimizer_postRA.cpp +++ b/src/amd/compiler/aco_optimizer_postRA.cpp @@ -657,6 +657,11 @@ try_reassign_split_vector(pr_opt_ctx& ctx, aco_ptr& instr) if (op.regClass() == s2 && reg.reg() % 2 != 0) break; + /* Sub dword operands might need updates to SDWA/opsel, + * but we only track full register writes at the moment. + */ + assert(op.physReg().byte() == reg.byte()); + /* If there is only one use (left), recolor the split_vector definition */ if (ctx.uses[op.tempId()] == 1) def.setFixed(reg);