aco/lower_phis: fix all_preds_uniform with continue_or_break

Found in a Death Stranding shader with loop unrolling disabled.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 9a089baff1 ("aco: optimize boolean phis with uniform selections")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9193>
This commit is contained in:
Rhys Perry 2021-02-22 15:05:32 +00:00 committed by Marge Bot
parent 54c17e45ae
commit 75c9adf039
1 changed files with 2 additions and 2 deletions

View File

@ -168,14 +168,14 @@ void lower_divergent_bool_phi(Program *program, ssa_state *state, Block *block,
Builder bld(program);
if (!state->checked_preds_for_uniform) {
state->all_preds_uniform = !(block->kind & block_kind_merge);
state->all_preds_uniform = !(block->kind & block_kind_merge) &&
block->linear_preds.size() == block->logical_preds.size();
for (unsigned pred : block->logical_preds)
state->all_preds_uniform = state->all_preds_uniform && (program->blocks[pred].kind & block_kind_uniform);
state->checked_preds_for_uniform = true;
}
if (state->all_preds_uniform) {
assert(block->logical_preds.size() == block->linear_preds.size());
phi->opcode = aco_opcode::p_linear_phi;
return;
}