From 94f8cb29ee7c615e74b4a85e14ac9e22c5dd7f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Fri, 27 Nov 2020 21:31:50 +0100 Subject: [PATCH] aco: Fix NGG GS assert failure from the WG scan. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a temp which was defined in a branch but used outside, without a phi. Fixes: 62b5012ec35358a7c109746bfe1da33ca1b04f24 Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry 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 d4261628fd9..e98aa3fb8f4 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -11375,11 +11375,11 @@ std::pair ngg_gs_workgroup_reduce_and_scan(isel_context *ctx, Temp s /* Determine if the current lane is the first. */ Temp is_first_lane = bld.copy(bld.def(bld.lm), Operand(1u, ctx->program->wave_size == 64)); + Temp wave_id_in_tg = wave_id_in_threadgroup(ctx); begin_divergent_if_then(ctx, &ic, is_first_lane); bld.reset(ctx->block); /* The first lane of each wave stores the result of its subgroup reduction to LDS (NGG scratch). */ - Temp wave_id_in_tg = wave_id_in_threadgroup(ctx); Temp wave_id_in_tg_lds_addr = bld.vop2_e64(aco_opcode::v_lshlrev_b32, bld.def(v1), Operand(2u), wave_id_in_tg); store_lds(ctx, 4u, as_vgpr(ctx, sg_reduction), 0x1u, wave_id_in_tg_lds_addr, ctx->ngg_gs_scratch_addr, 4u);