diff --git a/.pick_status.json b/.pick_status.json index fffc404ff2b..775dfc2fbb5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1048,7 +1048,7 @@ "description": "spirv: Run repair_ssa if there are discard instructions", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 04eca9baa24..10fe5369eef 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -616,6 +616,7 @@ vtn_process_block(struct vtn_builder *b, return NULL; case SpvOpKill: + b->has_kill = true; block->branch_type = vtn_branch_type_discard; return NULL; @@ -1185,7 +1186,7 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func, * but instructions in the continue may use SSA defs in the loop body. * Therefore, we need to repair SSA to insert the needed phi nodes. */ - if (b->has_loop_continue) + if (b->has_loop_continue || b->has_kill) nir_repair_ssa_impl(func->impl); func->emitted = true; diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 69dbe890938..e8cb65a6697 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -679,6 +679,7 @@ struct vtn_builder { unsigned func_param_idx; bool has_loop_continue; + bool has_kill; /* false by default, set to true by the ContractionOff execution mode */ bool exact;