From: Rhys Perry Date: Fri, 31 Jan 2020 12:41:19 +0000 (+0000) Subject: aco: handle missing second predecessors at merge block phis X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2c4878de9f2acfd7b23ed2deea1af094b781c7d;p=mesa.git aco: handle missing second predecessors at merge block phis Signed-off-by: Rhys Perry CC: Reviewed-by: Daniel Schürmann Part-of: --- 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;