From 4d93fc25f0667805c8e8a95febf5adc4052f9282 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 5 Jun 2020 19:19:58 +0100 Subject: [PATCH] aco: count v_mul_lo_u32 as 16 cycles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are more, but this is a common one. Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_statistics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_statistics.cpp b/src/amd/compiler/aco_statistics.cpp index 2e78ab63cb1..fc0cf84674b 100644 --- a/src/amd/compiler/aco_statistics.cpp +++ b/src/amd/compiler/aco_statistics.cpp @@ -72,7 +72,8 @@ void collect_preasm_stats(Program *program) /* TODO: this incorrectly assumes instructions always take 4 cycles */ /* assume loops execute 4 times (TODO: it would be nice to be able to consider loop unrolling) */ unsigned iter = 1 << (block.loop_nest_depth * 2); - program->statistics[statistic_cycles] += 4 * iter; + unsigned cycles = instr->opcode == aco_opcode::v_mul_lo_u32 ? 16 : 4; + program->statistics[statistic_cycles] += cycles * iter; } program->statistics[statistic_vmem_clauses] += vmem_clause_res.size();