Commit ad4fb7ea authored by Juan Suárez Romero's avatar Juan Suárez Romero

nir/spirv: skip unreachable blocks in Phi second pass

Only the blocks that are reachable are inserted with an end_nop
instruction at the end.

When handling the Phi second pass, if the Phi has a parent block that
does not have an end_nop then it means this block is unreachable, and
thus we can ignore it, as the Phi will never come through it.

Fixes dEQP-VK.graphicsfuzz.uninit-element-cast-in-loop.
Reviewed-by: Caio Marcelo de Oliveira Filho's avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
parent 5f8daae4
Pipeline #94867 passed with stages
in 16 minutes and 35 seconds
......@@ -811,6 +811,11 @@ vtn_handle_phi_second_pass(struct vtn_builder *b, SpvOp opcode,
struct vtn_block *pred =
vtn_value(b, w[i + 1], vtn_value_type_block)->block;
/* If block does not have end_nop, that is because it is an unreacheable
* block, and hence it is not worth to handle it */
if (!pred->end_nop)
continue;
b->nb.cursor = nir_after_instr(&pred->end_nop->instr);
struct vtn_ssa_value *src = vtn_ssa_value(b, w[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment