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);
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);
+ }
}
}
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
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);
}
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
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;
}
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;
}
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);
remove_unused_regs(impl, &state);
+ nir_metadata_preserve(impl, nir_metadata_block_index |
+ nir_metadata_dominance);
+
destroy_rewrite_state(&state);
}