From: Timur Kristóf Date: Mon, 10 Apr 2023 11:14:02 +0000 (+0200) Subject: aco: Fix optimization of v_cmp with subgroup invocation. X-Git-Tag: upstream/23.3.3~10226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cff02468c6448d33a7c999d88e625040a319d797;p=platform%2Fupstream%2Fmesa.git aco: Fix optimization of v_cmp with subgroup invocation. There was a typo in this optimization which went unnoticed. Fixes: 2c40215ab9d20890efb88e7b3e26ca909d7fd74b Signed-off-by: Timur Kristóf Reviewed-by: Georg Lehmann Part-of: --- diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 272ef84..cb31857 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2354,7 +2354,7 @@ bool optimize_cmp_subgroup_invocation(opt_ctx& ctx, aco_ptr& 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& 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;