nir/lower_io: preserve all metadata when no progress
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 4 Oct 2021 18:24:00 +0000 (21:24 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 Oct 2021 11:23:23 +0000 (11:23 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13168>

src/compiler/nir/nir_lower_io.c

index d96efb4..faaa1d7 100644 (file)
@@ -2129,6 +2129,8 @@ nir_lower_explicit_io_impl(nir_function_impl *impl, nir_variable_mode modes,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
@@ -2222,6 +2224,8 @@ nir_lower_vars_to_explicit_types_impl(nir_function_impl *impl,
                                   nir_metadata_dominance |
                                   nir_metadata_live_ssa_defs |
                                   nir_metadata_loop_analysis);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;