From ba809dccb8ce3e877860573acacfc2df25a075ec Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 23 Jun 2023 15:39:32 +0100 Subject: [PATCH] nir/deref: remove rematerialize_deref_in_block cache Nothing was ever inserted into this. Signed-off-by: Rhys Perry Reviewed-by: Konstantin Seurer Part-of: --- src/compiler/nir/nir_deref.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index d26ef26..0513974 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -744,7 +744,6 @@ struct rematerialize_deref_state { bool progress; nir_builder builder; nir_block *block; - struct hash_table *cache; }; static nir_deref_instr * @@ -754,14 +753,6 @@ rematerialize_deref_in_block(nir_deref_instr *deref, if (deref->instr.block == state->block) return deref; - if (!state->cache) { - state->cache = _mesa_pointer_hash_table_create(NULL); - } - - struct hash_entry *cached = _mesa_hash_table_search(state->cache, deref); - if (cached) - return cached->data; - nir_builder *b = &state->builder; nir_deref_instr *new_deref = nir_deref_instr_create(b->shader, deref->deref_type); @@ -850,10 +841,6 @@ nir_rematerialize_derefs_in_use_blocks_impl(nir_function_impl *impl) nir_foreach_block_unstructured(block, impl) { state.block = block; - /* Start each block with a fresh cache */ - if (state.cache) - _mesa_hash_table_clear(state.cache, NULL); - nir_foreach_instr_safe(instr, block) { if (instr->type == nir_instr_type_deref && nir_deref_instr_remove_if_unused(nir_instr_as_deref(instr))) @@ -876,8 +863,6 @@ nir_rematerialize_derefs_in_use_blocks_impl(nir_function_impl *impl) #endif } - _mesa_hash_table_destroy(state.cache, NULL); - return state.progress; } -- 2.7.4