aco: handle missing second predecessors at merge block phis

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>
This commit is contained in:
Rhys Perry 2020-01-31 12:41:19 +00:00 committed by Marge Bot
parent f1a2e1df78
commit f2c4878de9

View file

@ -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;