aco: Fix optimization of v_cmp with subgroup invocation.

There was a typo in this optimization which went unnoticed.

Fixes: 2c40215ab9
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22393>
This commit is contained in:
Timur Kristóf 2023-04-10 13:14:02 +02:00 committed by Marge Bot
parent 57afa79933
commit cff02468c6

View file

@ -2354,7 +2354,7 @@ bool
optimize_cmp_subgroup_invocation(opt_ctx& ctx, aco_ptr<Instruction>& instr)
{
/* This optimization only applies to VOPC with 2 operands. */
if (instr->operands.size() == 2)
if (instr->operands.size() != 2)
return false;
/* Find the constant operand or return early if there isn't one. */
@ -2420,7 +2420,7 @@ optimize_cmp_subgroup_invocation(opt_ctx& ctx, aco_ptr<Instruction>& instr)
cpy->definitions[0] = instr->definitions[0];
ctx.info[instr->definitions[0].tempId()].label = 0;
decrease_uses(ctx, ctx.instructions[mbcnt_op_idx].get());
decrease_uses(ctx, ctx.info[mbcnt_op.tempId()].instr);
instr.reset(cpy);
return true;