nir: Remove impl->{registers,reg_alloc}
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 1 Aug 2023 15:03:10 +0000 (11:03 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 22:40:28 +0000 (22:40 +0000)
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/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_inline_functions.c
src/compiler/nir/nir_sweep.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir_ra.c
src/gallium/drivers/lima/ir/pp/nir.c
src/panfrost/compiler/bifrost_compile.c

index 55cb79b..09830bd 100644 (file)
@@ -568,7 +568,6 @@ nir_function_impl_create_bare(nir_shader *shader)
 
    exec_list_make_empty(&impl->body);
    exec_list_make_empty(&impl->locals);
-   impl->reg_alloc = 0;
    impl->ssa_alloc = 0;
    impl->num_blocks = 0;
    impl->valid_metadata = nir_metadata_none;
index e21eb7b..db9bfe2 100644 (file)
@@ -3225,12 +3225,6 @@ typedef struct {
    /** list for all local variables in the function */
    struct exec_list locals;
 
-   /** list of local registers in the function */
-   struct exec_list registers;
-
-   /** next available local register index */
-   unsigned reg_alloc;
-
    /** next available SSA value index */
    unsigned ssa_alloc;
 
index f46a309..e18ce25 100644 (file)
@@ -40,7 +40,6 @@ void nir_inline_function_impl(struct nir_builder *b,
    nir_function_impl *copy = nir_function_impl_clone(b->shader, impl);
 
    exec_list_append(&b->impl->locals, &copy->locals);
-   exec_list_append(&b->impl->registers, &copy->registers);
 
    nir_foreach_block(block, copy) {
       nir_foreach_instr_safe(instr, block) {
index 4ebe12f..5ac7f59 100644 (file)
@@ -120,7 +120,6 @@ sweep_impl(nir_shader *nir, nir_function_impl *impl)
    ralloc_steal(nir, impl);
 
    steal_list(nir, nir_variable, &impl->locals);
-   steal_list(nir, nir_register, &impl->registers);
 
    foreach_list_typed(nir_cf_node, cf_node, node, &impl->body) {
       sweep_cf_node(nir, cf_node);
@@ -161,7 +160,7 @@ nir_sweep(nir_shader *nir)
    if (nir->info.label)
       ralloc_steal(nir, (char *)nir->info.label);
 
-   /* Variables and registers are not dead.  Steal them back. */
+   /* Variables are not dead.  Steal them back. */
    steal_list(nir, nir_variable, &nir->variables);
 
    /* Recurse into functions, stealing their contents back. */
index ae61ffa..64013f3 100644 (file)
@@ -136,7 +136,7 @@ etna_ra_assign(struct etna_compile *c, nir_shader *shader)
    /* this gives an approximation/upper limit on how many nodes are needed
     * (some ssa values do not represent an allocated register)
     */
-   unsigned max_nodes = impl->ssa_alloc + impl->reg_alloc;
+   unsigned max_nodes = impl->ssa_alloc;
    unsigned *live_map = ralloc_array(NULL, unsigned, max_nodes);
    memset(live_map, 0xff, sizeof(unsigned) * max_nodes);
    struct live_def *defs = rzalloc_array(NULL, struct live_def, max_nodes);
index fe093bb..995b46a 100644 (file)
@@ -952,7 +952,6 @@ bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *n
                       struct util_debug_callback *debug)
 {
    nir_function_impl *func = nir_shader_get_entrypoint(nir);
-   assert(func->reg_alloc == 0);
    ppir_compiler *comp = ppir_compiler_create(prog, func->ssa_alloc);
    if (!comp)
       return false;
index a442dd0..37ab72a 100644 (file)
@@ -4817,7 +4817,6 @@ bi_compile_variant_nir(nir_shader *nir,
          rzalloc_array(ctx, bi_block *, impl->num_blocks);
 
       ctx->ssa_alloc += impl->ssa_alloc;
-      ctx->reg_alloc += impl->reg_alloc;
 
       emit_cf_list(ctx, &impl->body);
       bi_emit_phis_deferred(ctx);