From f1a2e1df7882e9d3816f28d6a0827d4ac66ac8f6 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 31 Jan 2020 12:40:51 +0000 Subject: [PATCH] aco: set has_divergent_branch for discards in loops MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry CC: Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 29d40d18b25..7b429f69350 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -4462,6 +4462,9 @@ void visit_discard(isel_context* ctx, nir_intrinsic_instr *instr) ctx->block->kind |= block_kind_break; unsigned idx = ctx->block->index; + ctx->cf_info.parent_loop.has_divergent_branch = true; + ctx->cf_info.nir_to_aco[instr->instr.block->index] = idx; + /* remove critical edges from linear CFG */ bld.branch(aco_opcode::p_branch); Block* break_block = ctx->program->create_and_insert_block(); -- 2.30.2