[Mesa-dev] [PATCH] nir: Remove nir_array from lower_locals_to_regs

Thomas Helland thomashelland90 at gmail.com
Thu Dec 15 22:36:54 UTC 2016


We do nothing but initialize it, add to it, and delete it.
This is a fallout from removing constant initializer support.

CC: Jason Ekstrand <jason.ekstrand at intel.com>
---
 src/compiler/nir/nir_lower_locals_to_regs.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c
index 25a62b3..f1af237 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -35,12 +35,6 @@ struct locals_to_regs_state {
    /* A hash table mapping derefs to registers */
    struct hash_table *regs_table;
 
-   /* A growing array of derefs that we have encountered.  There is exactly
-    * one element of this array per element in the hash table.  This is
-    * used to make adding register initialization code deterministic.
-    */
-   nir_array derefs_array;
-
    bool progress;
 };
 
@@ -124,7 +118,6 @@ get_reg_for_deref(nir_deref_var *deref, struct locals_to_regs_state *state)
    reg->bit_size = glsl_get_bit_size(tail->type);
 
    _mesa_hash_table_insert_pre_hashed(state->regs_table, hash, deref, reg);
-   nir_array_add(&state->derefs_array, nir_deref_var *, deref);
 
    return reg;
 }
@@ -280,7 +273,6 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
    state.impl = impl;
    state.progress = false;
    state.regs_table = _mesa_hash_table_create(NULL, hash_deref, derefs_equal);
-   nir_array_init(&state.derefs_array, NULL);
 
    nir_metadata_require(impl, nir_metadata_dominance);
 
@@ -291,7 +283,6 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
 
-   nir_array_fini(&state.derefs_array);
    _mesa_hash_table_destroy(state.regs_table, NULL);
 
    return state.progress;
-- 
2.9.3



More information about the mesa-dev mailing list