From d80c7f3406b80ae684a709de57a9ef3d54a497b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Thu, 28 Oct 2021 15:48:19 +0200 Subject: [PATCH] aco: Fix how p_is_helper interacts with optimizations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit p_is_helper doesn't have any operands, so ACO's value numbering and/or the pre-RA optimizer could incorrectly recognize two such instructions as the same. This patch adds exec as an operand to p_is_helper in order to achieve correct behavior. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5570 Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 5a23c78..5b3d22c 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -8707,7 +8707,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr) /* load_helper() after demote() get lowered to is_helper(). * Otherwise, these two behave the same. */ Temp dst = get_ssa_temp(ctx, &instr->dest.ssa); - bld.pseudo(aco_opcode::p_is_helper, Definition(dst)); + bld.pseudo(aco_opcode::p_is_helper, Definition(dst), Operand(exec, bld.lm)); ctx->block->kind |= block_kind_needs_lowering; ctx->program->needs_exact = true; break; -- 2.7.4