Commit 295faf94 authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

nir: Call nir_metadata_preserve more places


Reviewed-by: default avatarConnor Abbott <cwabbott0@gmail.com>
parent b6c81b3f
......@@ -843,6 +843,9 @@ nir_convert_from_ssa_impl(nir_function_impl *impl)
nir_foreach_block(impl, resolve_parallel_copies_block, &state);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
/* Clean up dead instructions and the hash tables */
_mesa_hash_table_destroy(state.ssa_table, NULL);
_mesa_hash_table_destroy(state.merge_node_table, NULL);
......
......@@ -137,7 +137,10 @@ void
nir_lower_atomics(nir_shader *shader)
{
nir_foreach_overload(shader, overload) {
if (overload->impl)
if (overload->impl) {
nir_foreach_block(overload->impl, lower_block, overload->impl);
nir_metadata_preserve(overload->impl, nir_metadata_block_index |
nir_metadata_dominance);
}
}
}
......@@ -310,6 +310,9 @@ nir_lower_io_impl(nir_function_impl *impl)
state.mem_ctx = ralloc_parent(impl);
nir_foreach_block(impl, nir_lower_io_block, &state);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
}
void
......
......@@ -292,6 +292,9 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
nir_foreach_block(impl, lower_locals_to_regs_block, &state);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
_mesa_hash_table_destroy(state.regs_table, NULL);
}
......
......@@ -91,6 +91,8 @@ static void
convert_impl(nir_function_impl *impl)
{
nir_foreach_block(impl, convert_block, NULL);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
}
void
......
......@@ -330,6 +330,10 @@ nir_opt_constant_folding_impl(nir_function_impl *impl)
nir_foreach_block(impl, constant_fold_block, &state);
if (state.progress)
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
return state.progress;
}
......
......@@ -166,6 +166,10 @@ nir_opt_dce_impl(nir_function_impl *impl)
bool progress = false;
nir_foreach_block(impl, delete_block_cb, &progress);
if (progress)
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
return progress;
}
......
......@@ -630,7 +630,7 @@ destroy_rewrite_state(rewrite_state *state)
void
nir_convert_to_ssa_impl(nir_function_impl *impl)
{
nir_calc_dominance_impl(impl);
nir_metadata_require(impl, nir_metadata_dominance);
insert_phi_nodes(impl);
......@@ -641,6 +641,9 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
remove_unused_regs(impl, &state);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
destroy_rewrite_state(&state);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment