aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2020-01-31 12:41:19 +0000
committerMarge Bot <[email protected]>2020-03-23 15:55:12 +0000
commitf2c4878de9f2acfd7b23ed2deea1af094b781c7d (patch)
tree0c99e47eda269f844b6a0c0463d911de2351f5a3 /src/amd
parentf1a2e1df7882e9d3816f28d6a0827d4ac66ac8f6 (diff)
aco: handle missing second predecessors at merge block phis
Signed-off-by: Rhys Perry <[email protected]> CC: <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 7b429f69350..3ffa6153d46 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8253,6 +8253,10 @@ void visit_phi(isel_context *ctx, nir_phi_instr *instr)
continue;
}
}
+ /* Handle missing predecessors at the end. This shouldn't happen with loop
+ * headers and we can't ignore these sources for loop header phis. */
+ if (!(ctx->block->kind & block_kind_loop_header) && cur_pred_idx >= preds.size())
+ continue;
cur_pred_idx++;
Operand op = get_phi_operand(ctx, src.second);
operands[num_operands++] = op;