nir: Call nir_metadata_preserve more places
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
b6c81b3ff4
commit
295faf9462
|
@ -843,6 +843,9 @@ nir_convert_from_ssa_impl(nir_function_impl *impl)
|
||||||
|
|
||||||
nir_foreach_block(impl, resolve_parallel_copies_block, &state);
|
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 */
|
/* Clean up dead instructions and the hash tables */
|
||||||
_mesa_hash_table_destroy(state.ssa_table, NULL);
|
_mesa_hash_table_destroy(state.ssa_table, NULL);
|
||||||
_mesa_hash_table_destroy(state.merge_node_table, NULL);
|
_mesa_hash_table_destroy(state.merge_node_table, NULL);
|
||||||
|
|
|
@ -137,7 +137,10 @@ void
|
||||||
nir_lower_atomics(nir_shader *shader)
|
nir_lower_atomics(nir_shader *shader)
|
||||||
{
|
{
|
||||||
nir_foreach_overload(shader, overload) {
|
nir_foreach_overload(shader, overload) {
|
||||||
if (overload->impl)
|
if (overload->impl) {
|
||||||
nir_foreach_block(overload->impl, lower_block, 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);
|
state.mem_ctx = ralloc_parent(impl);
|
||||||
|
|
||||||
nir_foreach_block(impl, nir_lower_io_block, &state);
|
nir_foreach_block(impl, nir_lower_io_block, &state);
|
||||||
|
|
||||||
|
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||||
|
nir_metadata_dominance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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_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);
|
_mesa_hash_table_destroy(state.regs_table, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ static void
|
||||||
convert_impl(nir_function_impl *impl)
|
convert_impl(nir_function_impl *impl)
|
||||||
{
|
{
|
||||||
nir_foreach_block(impl, convert_block, NULL);
|
nir_foreach_block(impl, convert_block, NULL);
|
||||||
|
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||||
|
nir_metadata_dominance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -330,6 +330,10 @@ nir_opt_constant_folding_impl(nir_function_impl *impl)
|
||||||
|
|
||||||
nir_foreach_block(impl, constant_fold_block, &state);
|
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;
|
return state.progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,10 @@ nir_opt_dce_impl(nir_function_impl *impl)
|
||||||
bool progress = false;
|
bool progress = false;
|
||||||
nir_foreach_block(impl, delete_block_cb, &progress);
|
nir_foreach_block(impl, delete_block_cb, &progress);
|
||||||
|
|
||||||
|
if (progress)
|
||||||
|
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||||
|
nir_metadata_dominance);
|
||||||
|
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -630,7 +630,7 @@ destroy_rewrite_state(rewrite_state *state)
|
||||||
void
|
void
|
||||||
nir_convert_to_ssa_impl(nir_function_impl *impl)
|
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);
|
insert_phi_nodes(impl);
|
||||||
|
|
||||||
|
@ -641,6 +641,9 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
|
||||||
|
|
||||||
remove_unused_regs(impl, &state);
|
remove_unused_regs(impl, &state);
|
||||||
|
|
||||||
|
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||||
|
nir_metadata_dominance);
|
||||||
|
|
||||||
destroy_rewrite_state(&state);
|
destroy_rewrite_state(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue