From cff02468c6448d33a7c999d88e625040a319d797 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Mon, 10 Apr 2023 13:14:02 +0200 Subject: [PATCH] aco: Fix optimization of v_cmp with subgroup invocation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There was a typo in this optimization which went unnoticed. Fixes: 2c40215ab9d20890efb88e7b3e26ca909d7fd74b Signed-off-by: Timur Kristóf Reviewed-by: Georg Lehmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.7.4