From 9533e7cdae4722e306708624ace4226a6ab0dcdd Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 30 Sep 2025 19:07:19 +0200 Subject: [PATCH] aco/optimizer: fix incorrect operand order assumption for neg(mul) opt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code that labels instructions doesn't care about the order either. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14013 Cc: mesa-stable Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_optimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 099eb1e1d91..b78f135fc20 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -3757,7 +3757,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr& instr) /* neg(mul(a, b)) -> mul(neg(a), b), abs(mul(a, b)) -> mul(abs(a), abs(b)) */ if ((ctx.info[instr->definitions[0].tempId()].label & (label_neg | label_abs)) && - ctx.uses[instr->operands[1].tempId()] == 1) { + ctx.uses[ctx.info[instr->definitions[0].tempId()].temp.id()] == 1) { Temp val = ctx.info[instr->definitions[0].tempId()].temp; Instruction* mul_instr = ctx.info[val.id()].parent_instr;