From ec66109c1d2a5635a1e3567d6921081b965a6d39 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 17 Sep 2024 10:10:35 -0700 Subject: [PATCH] intel/perf: delete dead code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inner loop with p is dead, because n_passes_written is no longer updated as of 56bd81ee21cb42e4a5afa2939514b570a1283754, so it is always comparing a uint32_t < 0, which is never true. Since the inner loop is dead code, the pass array is dead code, as it simply keeps writing to element 0, and but never reads or uses it, along with all of the pass count information. Reviewed-by: José Roberto de Souza Part-of: --- src/intel/perf/intel_perf.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/intel/perf/intel_perf.c b/src/intel/perf/intel_perf.c index a50dbd6d06c..8ba614e0ae4 100644 --- a/src/intel/perf/intel_perf.c +++ b/src/intel/perf/intel_perf.c @@ -919,11 +919,6 @@ intel_perf_get_counters_passes(struct intel_perf_config *perf, BITSET_ZERO(queries_mask); get_passes_mask(perf, counter_indices, counter_indices_count, queries_mask); - ASSERTED uint32_t n_passes = BITSET_COUNT(queries_mask); - - struct intel_perf_query_info **pass_array = calloc(perf->n_queries, - sizeof(*pass_array)); - uint32_t n_written_passes = 0; for (uint32_t i = 0; i < counter_indices_count; i++) { assert(counter_indices[i] < perf->n_counters); @@ -945,22 +940,7 @@ intel_perf_get_counters_passes(struct intel_perf_config *perf, assert(query_idx != UINT32_MAX); counter_pass[i].query = &perf->queries[query_idx]; - - uint32_t pass_idx = UINT32_MAX; - for (uint32_t p = 0; p < n_written_passes; p++) { - if (pass_array[p] == counter_pass[i].query) { - pass_idx = p; - break; - } - } - - if (pass_idx == UINT32_MAX) - pass_array[n_written_passes] = counter_pass[i].query; - - assert(n_written_passes <= n_passes); } - - free(pass_array); } /* Accumulate 32bits OA counters */