aco/optimizer: fix incorrect operand order assumption for neg(mul) opt

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 <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37643>
This commit is contained in:
Georg Lehmann
2025-09-30 19:07:19 +02:00
committed by Marge Bot
parent 700ccea319
commit 9533e7cdae
+1 -1
View File
@@ -3757,7 +3757,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 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;