nir: preserve all metadata when nir_opt_vectorize doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
This commit is contained in:
Marcin Ślusarz 2021-08-10 12:46:55 +02:00 committed by Marge Bot
parent 54df09c8d4
commit e26328582a
1 changed files with 4 additions and 1 deletions

View File

@ -420,9 +420,12 @@ nir_opt_vectorize_impl(struct nir_shader *nir, nir_function_impl *impl,
bool progress = vectorize_block(nir, nir_start_block(impl), instr_set,
filter, data);
if (progress)
if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
} else {
nir_metadata_preserve(impl, nir_metadata_all);
}
vec_instr_set_destroy(instr_set);
return progress;