intel/perf: delete dead code.

The inner loop with p is dead, because n_passes_written is no longer
updated as of 56bd81ee21, 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 <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31213>
This commit is contained in:
Dylan Baker
2024-09-17 10:10:35 -07:00
committed by Marge Bot
parent 96a9ea57d9
commit ec66109c1d

View File

@@ -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 */