nir: Remove impl->{registers,reg_alloc}

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>
This commit is contained in:
Alyssa Rosenzweig 2023-08-01 11:03:10 -04:00 committed by Marge Bot
parent 20f38b4b41
commit 0bbf458a32
7 changed files with 2 additions and 13 deletions

View 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;

View 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;

View 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) {

View 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. */

View 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);

View 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;

View 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);