From 5344abbc569102ed30a5c794737f7902e81654a4 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 22 May 2025 16:30:46 +0100 Subject: [PATCH] aco/lower_branches: keep blocks with multiple logical successors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It might be the case that both the branch and exec mask write in a divergent branch block are removed. try_remove_simple_block() might then try to remove it, but fail because it has multiple logical successors. Instead, just skip these blocks. Signed-off-by: Rhys Perry Backport-to: 25.1 Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_lower_branches.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_lower_branches.cpp b/src/amd/compiler/aco_lower_branches.cpp index 2209b8f6f44..c78f17d564c 100644 --- a/src/amd/compiler/aco_lower_branches.cpp +++ b/src/amd/compiler/aco_lower_branches.cpp @@ -553,7 +553,7 @@ lower_branches(Program* program) if (block.kind & block_kind_break) try_merge_break_with_continue(ctx, block); - if (block.linear_succs.size() == 1) + if (block.linear_succs.size() == 1 && block.logical_succs.size() <= 1) try_remove_simple_block(ctx, block); }