aco: remove fast path in insert_exec_mask's process_instructions
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 8 Sep 2022 17:05:59 +0000 (18:05 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 14 Sep 2023 09:25:22 +0000 (09:25 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>

src/amd/compiler/aco_insert_exec_mask.cpp
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_ir.h
src/amd/compiler/aco_print_ir.cpp

index af71772..4a495be 100644 (file)
@@ -537,19 +537,6 @@ process_instructions(exec_ctx& ctx, Block* block, std::vector<aco_ptr<Instructio
       state = Exact;
    }
 
-   /* 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 || 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(),
-                          std::move_iterator<std::vector<aco_ptr<Instruction>>::iterator>(it),
-                          std::move_iterator<std::vector<aco_ptr<Instruction>>::iterator>(
-                             block->instructions.end()));
-      return;
-   }
-
    Builder bld(ctx.program, &instructions);
 
    for (; idx < block->instructions.size(); idx++) {
index c62abb3..2e12d7d 100644 (file)
@@ -8712,7 +8712,6 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
        * Otherwise, these two behave the same. */
       Temp dst = get_ssa_temp(ctx, &instr->def);
       bld.pseudo(aco_opcode::p_is_helper, Definition(dst), Operand(exec, bld.lm));
-      ctx->block->kind |= block_kind_needs_lowering;
       ctx->program->needs_exact = true;
       break;
    }
@@ -8778,7 +8777,6 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
        */
       Temp elected = bld.pseudo(aco_opcode::p_elect, bld.def(bld.lm), Operand(exec, bld.lm));
       emit_wqm(bld, elected, get_ssa_temp(ctx, &instr->def));
-      ctx->block->kind |= block_kind_needs_lowering;
       break;
    }
    case nir_intrinsic_shader_clock: {
index df902cb..b8f6bc3 100644 (file)
@@ -1885,9 +1885,8 @@ enum block_kind {
    block_kind_invert = 1 << 10,
    block_kind_discard_early_exit = 1 << 11,
    block_kind_uses_discard = 1 << 12,
-   block_kind_needs_lowering = 1 << 13,
-   block_kind_resume = 1 << 14,
-   block_kind_export_end = 1 << 15,
+   block_kind_resume = 1 << 13,
+   block_kind_export_end = 1 << 14,
 };
 
 struct RegisterDemand {
index 0654dfc..ef8132f 100644 (file)
@@ -851,8 +851,6 @@ print_block_kind(uint16_t kind, FILE* output)
       fprintf(output, "invert, ");
    if (kind & block_kind_uses_discard)
       fprintf(output, "discard, ");
-   if (kind & block_kind_needs_lowering)
-      fprintf(output, "needs_lowering, ");
    if (kind & block_kind_export_end)
       fprintf(output, "export_end, ");
 }