From cd9187a1e1a810459028376ac7f0a633c0e0cd61 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Thu, 27 Jun 2024 17:28:48 +0200 Subject: [PATCH] aco/ra: fix affinity for s_addk The first, non SCC def matters. Reviewed-by: Rhys Perry Fixes: 39380d475a3 ("aco: add affinities for possible sopk optimizations") Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 9cf1f45d471..1dbd0151441 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2685,7 +2685,7 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) op = instr->operands[op_fixed_to_def0]; } else if (vop3_can_use_vop2acc(ctx, instr.get())) { op = instr->operands[2]; - } else if (sop2_can_use_sopk(ctx, instr.get())) { + } else if (i == 0 && sop2_can_use_sopk(ctx, instr.get())) { op = instr->operands[instr->operands[0].isLiteral()]; } else { continue;