From f2c4878de9f2acfd7b23ed2deea1af094b781c7d Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 31 Jan 2020 12:41:19 +0000 Subject: aco: handle missing second predecessors at merge block phis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry CC: Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/amd') 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; -- cgit v1.2.3