diff --git a/.pick_status.json b/.pick_status.json index f9f65d826a0..cbc35942289 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -754,7 +754,7 @@ "description": "ir3/array_to_ssa: fix updating/removing phis", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "3ac743c333e49c6c91e74073eb8ba01cc6762fc6", "notes": null diff --git a/src/freedreno/ir3/ir3_array_to_ssa.c b/src/freedreno/ir3/ir3_array_to_ssa.c index 3a34ae3f7b9..2b3849f8255 100644 --- a/src/freedreno/ir3/ir3_array_to_ssa.c +++ b/src/freedreno/ir3/ir3_array_to_ssa.c @@ -169,6 +169,8 @@ remove_trivial_phi(struct ir3_instruction *phi) static struct ir3_register * lookup_value(struct ir3_register *reg) { + if (!reg) + return NULL; if (reg->instr->opc == OPC_META_PHI) return reg->instr->data; return reg; @@ -252,14 +254,14 @@ ir3_array_to_ssa(struct ir3 *ir) foreach_block (block, &ir->block_list) { foreach_instr_safe (instr, &block->instr_list) { if (instr->opc == OPC_META_PHI) { - if (!(instr->flags & IR3_REG_ARRAY)) + if (!(instr->dsts[0]->flags & IR3_REG_ARRAY)) continue; if (instr->data != instr->dsts[0]) { list_del(&instr->node); continue; } for (unsigned i = 0; i < instr->srcs_count; i++) { - instr->srcs[i] = lookup_value(instr->srcs[i]); + instr->srcs[i]->def = lookup_value(instr->srcs[i]->def); } } else { foreach_dst (reg, instr) {