diff --git a/.pick_status.json b/.pick_status.json index 2b97427be4b..c7b5ab0bc1f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -499,7 +499,7 @@ "description": "aco: handle missing second predecessors at merge block phis", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 8abcb878bfb..4f1f7751572 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -7685,6 +7685,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;