From 7a4f121c5dda4ba124ae905270cacf551011be3a Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 10 Jun 2024 14:31:32 +0100 Subject: [PATCH] aco: remove some missing label resets In the case of: c = xor(a, b) d = not(c) xor(d, e) it will be optimized to: d = xnor(a, b) xor(d, e) because "d" would still had a label with "instr=not(c)", it would then be further optimized to: d = xnor(a, b) xnor(c, e) Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11309 Cc: mesa-stable Part-of: --- src/amd/compiler/aco_optimizer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 67e9bc17611..a34e074cb92 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2740,6 +2740,7 @@ combine_not_xor(opt_ctx& ctx, aco_ptr& instr) ctx.uses[instr->operands[0].tempId()]--; std::swap(instr->definitions[0], op_instr->definitions[0]); op_instr->opcode = aco_opcode::v_xnor_b32; + ctx.info[op_instr->definitions[0].tempId()].label = 0; return true; } @@ -2965,6 +2966,7 @@ use_absdiff: std::swap(instr->definitions[0], op_instr->definitions[0]); std::swap(instr->definitions[1], op_instr->definitions[1]); ctx.uses[instr->operands[0].tempId()]--; + ctx.info[op_instr->definitions[0].tempId()].label = 0; return true; }