From 8f291dc14600c614788301e3265ff7f0f48b8b0d Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 16 Dec 2019 11:29:08 +0000 Subject: [PATCH 1/1] aco: set exec_potentially_empty for demotes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Fixes: 93c8ebfa780 ('aco: Initial commit of independent AMD compiler') Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 5fcfeb66249..abcfe572a38 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -6195,6 +6195,9 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr) } case nir_intrinsic_demote: bld.pseudo(aco_opcode::p_demote_to_helper); + + if (ctx->cf_info.loop_nest_depth || ctx->cf_info.parent_if.is_divergent) + ctx->cf_info.exec_potentially_empty = true; ctx->block->kind |= block_kind_uses_demote; ctx->program->needs_exact = true; break; @@ -6203,6 +6206,9 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr) assert(src.regClass() == bld.lm); Temp cond = bld.sop2(Builder::s_and, bld.def(bld.lm), bld.def(s1, scc), src, Operand(exec, bld.lm)); bld.pseudo(aco_opcode::p_demote_to_helper, cond); + + if (ctx->cf_info.loop_nest_depth || ctx->cf_info.parent_if.is_divergent) + ctx->cf_info.exec_potentially_empty = true; ctx->block->kind |= block_kind_uses_demote; ctx->program->needs_exact = true; break; -- 2.30.2