From 8343e4546707f9839aa247e0cd664eb743fca4f7 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 26 Sep 2025 13:31:59 +0200 Subject: [PATCH] aco/lower_branches: update branch hints after changing jump targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 13ad3db43f9 ("aco/lower_branches: implement try_remove_simple_block() in lower_branches()") Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_lower_branches.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_lower_branches.cpp b/src/amd/compiler/aco_lower_branches.cpp index 0f5ea750d29..8fb1f02c4a8 100644 --- a/src/amd/compiler/aco_lower_branches.cpp +++ b/src/amd/compiler/aco_lower_branches.cpp @@ -68,6 +68,8 @@ try_remove_simple_block(branch_ctx& ctx, Block& block) pred.linear_succs[1] = pred.linear_succs.back(); /* In case of discard */ pred.linear_succs.pop_back(); branch->opcode = aco_opcode::p_branch; + branch->branch().never_taken = false; + branch->branch().rarely_taken = false; } else if (pred.linear_succs[1] == block.index) { /* The predecessor jumps to this block. Redirect to successor. */ pred.linear_succs[1] = succ_idx; @@ -105,6 +107,8 @@ try_remove_simple_block(branch_ctx& ctx, Block& block) branch->opcode = aco_opcode::p_cbranch_z; else branch->opcode = aco_opcode::p_cbranch_nz; + branch->branch().never_taken = false; + branch->branch().rarely_taken = false; } /* Update the branch target. */