diff options
author | Rhys Perry <[email protected]> | 2019-09-26 10:33:43 +0100 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-09-27 10:57:03 +0100 |
commit | b711e62e615095524a1af8dc4a6665bf1514a56c (patch) | |
tree | be1d6ce8e05327cbe69b7c80faa8a16136cb65ff | |
parent | 237c7636ca4c429d4dbfce95b6e3281a8309eac7 (diff) |
aco: set loop_info::has_discard for demotes
We need the loop header phis for the outer exec masks. Needed for
dEQP-VK.glsl.demote.dynamic_loop_texture
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
-rw-r--r-- | src/amd/compiler/aco_insert_exec_mask.cpp | 9 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 4 | ||||
-rw-r--r-- | src/amd/compiler/aco_ir.h | 1 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index 7886a4c77e2..b423c5b9190 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -72,7 +72,7 @@ struct loop_info { uint8_t needs; bool has_divergent_break; bool has_divergent_continue; - bool has_discard; + bool has_discard; /* has a discard or demote */ loop_info(Block* b, uint16_t num, uint8_t needs, bool breaks, bool cont, bool discard) : loop_header(b), num_exec_masks(num), needs(needs), has_divergent_break(breaks), has_divergent_continue(cont), has_discard(discard) {} @@ -279,7 +279,8 @@ void calculate_wqm_needs(exec_ctx& exec_ctx) ever_again_needs |= exec_ctx.info[i].block_needs & ~Exact_Branch; if (block.kind & block_kind_discard || - block.kind & block_kind_uses_discard_if) + block.kind & block_kind_uses_discard_if || + block.kind & block_kind_uses_demote) ever_again_needs |= Exact; /* don't propagate WQM preservation further than the next top_level block */ @@ -629,6 +630,7 @@ void process_instructions(exec_ctx& ctx, Block* block, (ctx.info[block->index].block_needs & state) != (ctx.info[block->index].block_needs & (WQM | Exact))) || block->kind & block_kind_uses_discard_if || + block->kind & block_kind_uses_demote || block->kind & block_kind_needs_lowering; if (!process) { std::vector<aco_ptr<Instruction>>::iterator it = std::next(block->instructions.begin(), idx); @@ -811,7 +813,8 @@ void add_branch_code(exec_ctx& ctx, Block* block) needs |= ctx.info[i].block_needs; if (loop_block.kind & block_kind_uses_discard_if || - loop_block.kind & block_kind_discard) + loop_block.kind & block_kind_discard || + loop_block.kind & block_kind_uses_demote) has_discard = true; if (loop_block.loop_nest_depth != loop_nest_depth) continue; diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 7405b1142f9..7b5dc7f7426 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -5831,7 +5831,7 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr) } case nir_intrinsic_demote: bld.pseudo(aco_opcode::p_demote_to_helper); - ctx->block->kind |= block_kind_needs_lowering; + ctx->block->kind |= block_kind_uses_demote; ctx->program->needs_exact = true; break; case nir_intrinsic_demote_if: { @@ -5839,7 +5839,7 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr) as_divergent_bool(ctx, get_ssa_temp(ctx, instr->src[0].ssa), false), Operand(exec, s2)); bld.pseudo(aco_opcode::p_demote_to_helper, cond); - ctx->block->kind |= block_kind_needs_lowering; + ctx->block->kind |= block_kind_uses_demote; ctx->program->needs_exact = true; break; } diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 139dd1e371c..24ff6a2b142 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -924,6 +924,7 @@ enum block_kind { block_kind_invert = 1 << 11, block_kind_uses_discard_if = 1 << 12, block_kind_needs_lowering = 1 << 13, + block_kind_uses_demote = 1 << 14, }; |