nir: Preserve metadata if remove_dead_derefs makes no progress

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482>
This commit is contained in:
Jason Ekstrand 2022-05-12 13:59:30 -05:00 committed by Marge Bot
parent a064e63e83
commit c23b20d43a

View file

@ -376,9 +376,12 @@ nir_remove_dead_derefs_impl(nir_function_impl *impl)
}
}
if (progress)
if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
} else {
nir_metadata_preserve(impl, nir_metadata_all);
}
return progress;
}