nir: Remove nir_index_local_regs and callers

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>
This commit is contained in:
Alyssa Rosenzweig 2023-08-01 10:48:27 -04:00 committed by Marge Bot
parent 1bc05bb847
commit c11c75d1a1
5 changed files with 2 additions and 42 deletions

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

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

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

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

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