aco/lower_branches: Fix try_rotate_latch_block()

Found by inspection.

Fixes: 97f095f6e0 ('aco/lower_branches: Add try_rotate_latch_block() optimization')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40628>
This commit is contained in:
Daniel Schürmann 2026-03-25 14:18:54 +01:00 committed by Marge Bot
parent 60b3e5b3f0
commit 5e89be331f

View file

@ -599,7 +599,8 @@ try_rotate_latch_block(branch_ctx& ctx, Block& header)
continue;
} else if (pred.linear_succs[0] == block.index) {
/* Check if there is a fall-through path for the jump target. */
if (block.index > pred.linear_succs[1] || (pred.linear_succs[1] & block_kind_loop_latch))
if (block.index > pred.linear_succs[1] ||
(ctx.program->blocks[pred.linear_succs[1]].kind & block_kind_loop_latch))
return;
for (unsigned j = block.index + 1; j < pred.linear_succs[1]; j++) {