From 16eae62f0d9fe6c49baad8d6edf112ea57678829 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 29 Apr 2024 12:44:03 +0100 Subject: [PATCH] aco/stats: don't use VS counter pre-GFX10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_statistics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_statistics.cpp b/src/amd/compiler/aco_statistics.cpp index 1a969f49fa0..2e9d9e5bcba 100644 --- a/src/amd/compiler/aco_statistics.cpp +++ b/src/amd/compiler/aco_statistics.cpp @@ -281,7 +281,7 @@ BlockCycleEstimator::cycles_until_res_available(aco_ptr& instr) } static wait_counter_info -get_wait_counter_info(aco_ptr& instr) +get_wait_counter_info(amd_gfx_level gfx_level, aco_ptr& instr) { /* These numbers are all a bit nonsense. LDS/VMEM/SMEM/EXP performance * depends a lot on the situation. */ @@ -291,7 +291,7 @@ get_wait_counter_info(aco_ptr& instr) if (instr->isFlatLike()) { unsigned lgkm = instr->isFlat() ? 20 : 0; - if (!instr->definitions.empty()) + if (!instr->definitions.empty() || gfx_level < GFX10) return wait_counter_info(320, 0, lgkm, 0); else return wait_counter_info(0, 0, lgkm, 320); @@ -320,10 +320,10 @@ get_wait_counter_info(aco_ptr& instr) if (instr->isLDSDIR()) return wait_counter_info(0, 13, 0, 0); - if (instr->isVMEM() && !instr->definitions.empty()) + if (instr->isVMEM() && (!instr->definitions.empty() || gfx_level < GFX10)) return wait_counter_info(320, 0, 0, 0); - if (instr->isVMEM() && instr->definitions.empty()) + if (instr->isVMEM() && instr->definitions.empty() && gfx_level >= GFX10) return wait_counter_info(0, 0, 0, 320); return wait_counter_info(0, 0, 0, 0); @@ -352,7 +352,7 @@ get_wait_imm(Program* program, aco_ptr& instr) unsigned max_vm_cnt = program->gfx_level >= GFX9 ? 62 : 14; unsigned max_vs_cnt = 62; - wait_counter_info wait_info = get_wait_counter_info(instr); + wait_counter_info wait_info = get_wait_counter_info(program->gfx_level, instr); wait_imm imm; imm.lgkm = wait_info.lgkm ? max_lgkm_cnt : wait_imm::unset_counter; imm.exp = wait_info.exp ? max_exp_cnt : wait_imm::unset_counter; @@ -462,7 +462,7 @@ BlockCycleEstimator::add(aco_ptr& instr) while (vs.size() > imm.vs) vs.pop_front(); - wait_counter_info wait_info = get_wait_counter_info(instr); + wait_counter_info wait_info = get_wait_counter_info(program->gfx_level, instr); if (wait_info.exp) exp.push_back(cur_cycle + wait_info.exp); if (wait_info.lgkm)