diff --git a/.pick_status.json b/.pick_status.json index f6690e35431..4d593e1b300 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -598,7 +598,7 @@ "description": "aco: fix emitting discard when the program just ends", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 821be34c40b..75ab73528a5 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -5297,11 +5297,8 @@ void visit_discard(isel_context* ctx, nir_intrinsic_instr *instr) */ if (!ctx->cf_info.parent_if.is_divergent) { /* program just ends here */ - ctx->block->kind |= block_kind_uniform; - bld.exp(aco_opcode::exp, Operand(v1), Operand(v1), Operand(v1), Operand(v1), - 0 /* enabled mask */, 9 /* dest */, - false /* compressed */, true/* done */, true /* valid mask */); - bld.sopp(aco_opcode::s_endpgm); + ctx->block->kind |= block_kind_uses_discard_if; + bld.pseudo(aco_opcode::p_discard_if, Operand(0xFFFFFFFFu)); // TODO: it will potentially be followed by a branch which is dead code to sanitize NIR phis } else { ctx->block->kind |= block_kind_discard;