From de4b345949d1f02b0555fd5a991eedd252358cf9 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 6 Jul 2025 22:10:58 +0200 Subject: [PATCH] aco/insert_exec: remove per instruction wqm/exact exec handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No Foz-DB changes on GFX1201. Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_insert_exec_mask.cpp | 59 +---------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index d500d47a0f0..f87b1f0db13 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -59,24 +59,6 @@ struct exec_ctx { exec_ctx(Program* program_) : program(program_), info(program->blocks.size()) {} }; -bool -needs_exact(aco_ptr& instr) -{ - return false; -} - -WQMState -get_instr_needs(aco_ptr& instr) -{ - if (needs_exact(instr)) - return Exact; - - bool pred_by_exec = needs_exec_mask(instr.get()) || instr->opcode == aco_opcode::p_logical_end || - instr->isBranch(); - - return pred_by_exec ? WQM : Unspecified; -} - void transition_to_WQM(exec_ctx& ctx, Builder bld, unsigned idx) { @@ -378,33 +360,6 @@ add_coupling_code(exec_ctx& ctx, Block* block, std::vector> return i; } -/* Avoid live-range splits in Exact mode: - * Because the data register of atomic VMEM instructions - * is shared between src and dst, it might be necessary - * to create live-range splits during RA. - * Make the live-range splits explicit in WQM mode. - */ -void -handle_atomic_data(exec_ctx& ctx, Builder& bld, unsigned block_idx, aco_ptr& instr) -{ - /* check if this is an atomic VMEM instruction */ - int idx = -1; - if (!instr->isVMEM() || instr->definitions.empty()) - return; - else if (instr->isMIMG()) - idx = instr->operands[2].isTemp() ? 2 : -1; - else if (instr->operands.size() == 4) - idx = 3; - - if (idx != -1) { - /* insert explicit copy of atomic data in WQM-mode */ - transition_to_WQM(ctx, bld, block_idx); - Temp data = instr->operands[idx].getTemp(); - data = bld.copy(bld.def(data.regClass()), data); - instr->operands[idx].setTemp(data); - } -} - void remove_disable_wqm(Instruction* instr) { @@ -438,7 +393,7 @@ process_instructions(exec_ctx& ctx, Block* block, std::vectorinstructions.size(); idx++) { aco_ptr instr = std::move(block->instructions[idx]); - WQMState needs = ctx.handle_wqm ? get_instr_needs(instr) : Unspecified; - - if (needs == WQM && state != WQM) { - transition_to_WQM(ctx, bld, block->index); - state = WQM; - } else if (needs == Exact) { - if (ctx.handle_wqm) - handle_atomic_data(ctx, bld, block->index, instr); - transition_to_Exact(ctx, bld, block->index); - state = Exact; - } - if (instr->opcode == aco_opcode::p_discard_if) { Operand current_exec = Operand(exec, bld.lm);