Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/ir.c:
current_label = 0;
break;
info = &block_info[label - 1];
if (!(vkd3d_array_reserve((void **)&info->incomings, &info->incoming_capacity, info->incoming_count + 1,
sizeof(*info->incomings))))
goto fail;
incoming = &info->incomings[info->incoming_count++];
incoming->src = &ins->src[j];
incoming->dst = ins->dst;
++incoming_count; }
materialize_ssas_to_temps_process_dst_param(program, ins->dst);
Shouldn't you process the sources too? The PHI instruction is soon going to be dropped, but the parameters that are referenced by `incoming` will be later inserted back in the code stream, and the sources might very well come from another PHI instruction, I guess.