diff options
author | Juan A. Suarez Romero <[email protected]> | 2019-11-07 08:33:09 +0000 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2020-01-08 11:32:24 +0100 |
commit | ad4fb7ea04158c68415f26f8cc573bfac16826a3 (patch) | |
tree | a223d6c11aa22c69d883e35b03acd8ad0e80ff96 /src/compiler | |
parent | 5f8daae4d829c9f734d2f41058990809d2dba349 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/spirv/vtn_cfg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 67c3245126d..25e2f285e79 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -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]); |