nir: Remove nir_index_local_regs and callers
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 1 Aug 2023 14:48:27 +0000 (10:48 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 22:40:27 +0000 (22:40 +0000)
With no registers seen, it is now a no-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>

src/compiler/clc/nir_lower_libclc.c
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_inline_functions.c
src/compiler/nir/nir_lower_double_ops.c

index d6d9696..232e886 100644 (file)
@@ -85,7 +85,6 @@ nir_lower_libclc_impl(nir_function_impl *impl,
 
    if (progress) {
       nir_index_ssa_defs(impl);
-      nir_index_local_regs(impl);
       nir_metadata_preserve(impl, nir_metadata_none);
    } else {
       nir_metadata_preserve(impl, nir_metadata_all);
index b09e544..573d8df 100644 (file)
@@ -220,30 +220,6 @@ nir_shader_create(void *mem_ctx,
    return shader;
 }
 
-static nir_register *
-reg_create(void *mem_ctx, struct exec_list *list)
-{
-   nir_register *reg = ralloc(mem_ctx, nir_register);
-
-   list_inithead(&reg->uses);
-   list_inithead(&reg->defs);
-
-   reg->num_components = 0;
-   reg->bit_size = 32;
-   reg->num_array_elems = 0;
-   reg->divergent = false;
-
-   exec_list_push_tail(list, &reg->node);
-
-   return reg;
-}
-
-void
-nir_reg_remove(nir_register *reg)
-{
-   exec_node_remove(&reg->node);
-}
-
 void
 nir_shader_add_variable(nir_shader *shader, nir_variable *var)
 {
@@ -1381,16 +1357,6 @@ nir_instr_free_and_dce(nir_instr *instr)
 
 /*@}*/
 
-void
-nir_index_local_regs(nir_function_impl *impl)
-{
-   unsigned index = 0;
-   foreach_list_typed(nir_register, reg, node, &impl->registers) {
-      reg->index = index++;
-   }
-   impl->reg_alloc = index;
-}
-
 struct foreach_ssa_def_state {
    nir_foreach_ssa_def_cb cb;
    void *client_state;
index ed0ccf7..4db5bad 100644 (file)
@@ -4127,8 +4127,6 @@ nir_shader *nir_shader_create(void *mem_ctx,
                               const nir_shader_compiler_options *options,
                               shader_info *si);
 
-void nir_reg_remove(nir_register *reg);
-
 /** Adds a variable to the appropriate list in nir_shader */
 void nir_shader_add_variable(nir_shader *shader, nir_variable *var);
 
@@ -4674,7 +4672,6 @@ nir_loop *nir_block_get_following_loop(nir_block *block);
 
 nir_block **nir_block_get_predecessors_sorted(const nir_block *block, void *mem_ctx);
 
-void nir_index_local_regs(nir_function_impl *impl);
 void nir_index_ssa_defs(nir_function_impl *impl);
 unsigned nir_index_instrs(nir_function_impl *impl);
 
index c84400c..f46a309 100644 (file)
@@ -185,9 +185,8 @@ inline_function_impl(nir_function_impl *impl, struct set *inlined)
    }
 
    if (progress) {
-      /* SSA and register indices are completely messed up now */
+      /* Indices are completely messed up now */
       nir_index_ssa_defs(impl);
-      nir_index_local_regs(impl);
 
       nir_metadata_preserve(impl, nir_metadata_none);
    } else {
index 0caaf9b..1d106dd 100644 (file)
@@ -764,9 +764,8 @@ nir_lower_doubles_impl(nir_function_impl *impl,
                                            &data);
 
    if (progress && (options & nir_lower_fp64_full_software)) {
-      /* SSA and register indices are completely messed up now */
+      /* Indices are completely messed up now */
       nir_index_ssa_defs(impl);
-      nir_index_local_regs(impl);
 
       nir_metadata_preserve(impl, nir_metadata_none);