From 58653838f55031176796cb5843cc2a1f91a8f464 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 27 Apr 2020 13:53:59 +0100 Subject: [PATCH] aco: consider blocks unreachable if they are in the logical cfg backport of 9392ddab4399d796fdf37602f586965ec17f2b2a Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 0b69eb51c89..7f0b9148daa 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -8276,7 +8276,6 @@ static bool visit_if(isel_context *ctx, nir_if *if_stmt) ctx->block = ctx->program->insert_block(std::move(BB_endif)); append_logical_start(ctx->block); } - return !ctx->cf_info.has_branch; } else { /* non-uniform condition */ /** * To maintain a logical and linear CFG without critical edges, @@ -8312,9 +8311,9 @@ static bool visit_if(isel_context *ctx, nir_if *if_stmt) visit_cf_list(ctx, &if_stmt->else_list); end_divergent_if(ctx, &ic); - - return true; } + + return !ctx->cf_info.has_branch && !ctx->block->logical_preds.empty(); } static bool visit_cf_list(isel_context *ctx,