aco: merge block_kind_uses_[demote|discard_if]

These serve the same purpose. The new name is
block_kind_uses_discard.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
This commit is contained in:
Daniel Schürmann
2022-01-31 16:30:08 +01:00
committed by Marge Bot
parent e7d1c8cc5e
commit 13c3137960
4 changed files with 9 additions and 13 deletions
+3 -4
View File
@@ -320,7 +320,7 @@ calculate_wqm_needs(exec_ctx& exec_ctx)
exec_ctx.info[i].block_needs |= Exact;
ever_again_needs |= exec_ctx.info[i].block_needs & ~Exact_Branch;
if (block.kind & block_kind_uses_discard_if || block.kind & block_kind_uses_demote)
if (block.kind & block_kind_uses_discard)
ever_again_needs |= Exact;
/* don't propagate WQM preservation further than the next top_level block */
@@ -691,8 +691,7 @@ process_instructions(exec_ctx& ctx, Block* block, std::vector<aco_ptr<Instructio
/* if the block doesn't need both, WQM and Exact, we can skip processing the instructions */
bool process = (ctx.handle_wqm && (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;
block->kind & block_kind_uses_discard || block->kind & block_kind_needs_lowering;
if (!process) {
std::vector<aco_ptr<Instruction>>::iterator it = std::next(block->instructions.begin(), idx);
instructions.insert(instructions.end(),
@@ -887,7 +886,7 @@ add_branch_code(exec_ctx& ctx, Block* block)
Block& loop_block = ctx.program->blocks[i];
needs |= ctx.info[i].block_needs;
if (loop_block.kind & block_kind_uses_discard_if || loop_block.kind & block_kind_uses_demote)
if (loop_block.kind & block_kind_uses_discard)
has_discard = true;
if (loop_block.loop_nest_depth != loop_nest_depth)
continue;
@@ -8670,7 +8670,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
if (ctx->block->loop_nest_depth || ctx->cf_info.parent_if.is_divergent)
ctx->cf_info.exec_potentially_empty_discard = true;
ctx->block->kind |= block_kind_uses_demote;
ctx->block->kind |= block_kind_uses_discard;
ctx->program->needs_exact = true;
break;
case nir_intrinsic_demote_if: {
@@ -8682,7 +8682,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
if (ctx->block->loop_nest_depth || ctx->cf_info.parent_if.is_divergent)
ctx->cf_info.exec_potentially_empty_discard = true;
ctx->block->kind |= block_kind_uses_demote;
ctx->block->kind |= block_kind_uses_discard;
ctx->program->needs_exact = true;
break;
}
@@ -8703,7 +8703,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
if (ctx->block->loop_nest_depth || ctx->cf_info.parent_if.is_divergent)
ctx->cf_info.exec_potentially_empty_discard = true;
ctx->block->kind |= block_kind_uses_discard_if;
ctx->block->kind |= block_kind_uses_discard;
ctx->program->needs_exact = true;
break;
}
+1 -2
View File
@@ -1814,9 +1814,8 @@ enum block_kind {
block_kind_branch = 1 << 8,
block_kind_merge = 1 << 9,
block_kind_invert = 1 << 10,
block_kind_uses_discard_if = 1 << 12,
block_kind_uses_discard = 1 << 12,
block_kind_needs_lowering = 1 << 13,
block_kind_uses_demote = 1 << 14,
block_kind_export_end = 1 << 15,
};
+2 -4
View File
@@ -750,12 +750,10 @@ print_block_kind(uint16_t kind, FILE* output)
fprintf(output, "merge, ");
if (kind & block_kind_invert)
fprintf(output, "invert, ");
if (kind & block_kind_uses_discard_if)
fprintf(output, "discard_if, ");
if (kind & block_kind_uses_discard)
fprintf(output, "discard, ");
if (kind & block_kind_needs_lowering)
fprintf(output, "needs_lowering, ");
if (kind & block_kind_uses_demote)
fprintf(output, "uses_demote, ");
if (kind & block_kind_export_end)
fprintf(output, "export_end, ");
}