nir/deref: remove rematerialize_deref_in_block cache
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 23 Jun 2023 14:39:32 +0000 (15:39 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Sep 2023 10:05:58 +0000 (10:05 +0000)
Nothing was ever inserted into this.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>

src/compiler/nir/nir_deref.c

index d26ef26..0513974 100644 (file)
@@ -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;
 }