summaryrefslogtreecommitdiff
path: root/src/amd
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2021-02-22 15:05:32 +0000
committerDylan Baker <dylan.c.baker@intel.com>2021-02-23 13:51:00 -0800
commit73e1f3a3dd10e4fd25cdf93423d1b349a26e58e6 (patch)
tree4f046521ca2a07eb0502ac7ecb6d22fa18122ce7 /src/amd
parentac1880edc595e91216d543ccdbb7490fba84cce4 (diff)
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: 9a089baff1a ("aco: optimize boolean phis with uniform selections") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9193> (cherry picked from commit 75c9adf0398014b21ed9bbbd36f741b02b8f87f7)
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/compiler/aco_lower_phis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_lower_phis.cpp b/src/amd/compiler/aco_lower_phis.cpp
index 838c1807a74..6dcafb17af6 100644
--- a/src/amd/compiler/aco_lower_phis.cpp
+++ b/src/amd/compiler/aco_lower_phis.cpp
@@ -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;
}