From aa55ecc2961523cde276f556f6d8fa523bbbabfe Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 23 Feb 2022 17:21:42 +0000 Subject: [PATCH] aco/insert_exec_mask: fix top-level to-exact with non-global exact mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After transitioning to exact after a discard, the exec stack might be: [exact|global, wqm, exact] Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_insert_exec_mask.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index 62db890c0de..5638b4e8ce0 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -522,11 +522,13 @@ process_instructions(exec_ctx& ctx, Block* block, std::vectorindex].exec.size() >= 2) { if (needs == WQM) { /* Preserve the WQM mask */ - ctx.info[block->index].exec[1].second &= ~mask_type_global; + ctx.info[block->index].exec[1].second &= ~mask_type_global; } else if (block->kind & block_kind_top_level) { - assert(state == WQM); - /* Transition to Exact without extra instruction */ - ctx.info[block->index].exec.pop_back(); + /* Transition to Exact without extra instruction. Since needs != WQM, we won't need + * WQM again. + */ + ctx.info[block->index].exec.resize(1); + assert(ctx.info[block->index].exec[0].second == (mask_type_exact | mask_type_global)); current_exec = get_exec_op(ctx.info[block->index].exec.back().first); ctx.info[block->index].exec[0].first = Operand(bld.lm); }