nir: Call nir_metadata_preserve on !progress
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 22 May 2020 01:41:12 +0000 (20:41 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Jun 2020 05:08:12 +0000 (05:08 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>

42 files changed:
src/compiler/nir/nir.c
src/compiler/nir/nir_deref.c
src/compiler/nir/nir_inline_functions.c
src/compiler/nir/nir_lower_array_deref_of_vec.c
src/compiler/nir/nir_lower_bit_size.c
src/compiler/nir/nir_lower_bool_to_int32.c
src/compiler/nir/nir_lower_double_ops.c
src/compiler/nir/nir_lower_global_vars_to_local.c
src/compiler/nir/nir_lower_indirect_derefs.c
src/compiler/nir/nir_lower_load_const_to_scalar.c
src/compiler/nir/nir_lower_packing.c
src/compiler/nir/nir_lower_returns.c
src/compiler/nir/nir_lower_scratch.c
src/compiler/nir/nir_lower_var_copies.c
src/compiler/nir/nir_lower_variable_initializers.c
src/compiler/nir/nir_lower_vars_to_ssa.c
src/compiler/nir/nir_lower_vec_to_movs.c
src/compiler/nir/nir_opt_barriers.c
src/compiler/nir/nir_opt_combine_stores.c
src/compiler/nir/nir_opt_comparison_pre.c
src/compiler/nir/nir_opt_constant_folding.c
src/compiler/nir/nir_opt_copy_prop_vars.c
src/compiler/nir/nir_opt_copy_propagate.c
src/compiler/nir/nir_opt_cse.c
src/compiler/nir/nir_opt_dce.c
src/compiler/nir/nir_opt_dead_cf.c
src/compiler/nir/nir_opt_dead_write_vars.c
src/compiler/nir/nir_opt_find_array_copies.c
src/compiler/nir/nir_opt_idiv_const.c
src/compiler/nir/nir_opt_if.c
src/compiler/nir/nir_opt_intrinsics.c
src/compiler/nir/nir_opt_move.c
src/compiler/nir/nir_opt_peephole_select.c
src/compiler/nir/nir_opt_rematerialize_compares.c
src/compiler/nir/nir_opt_remove_phis.c
src/compiler/nir/nir_opt_trivial_continues.c
src/compiler/nir/nir_opt_undef.c
src/compiler/nir/nir_search.c
src/compiler/nir/nir_split_var_copies.c
src/compiler/nir/nir_split_vars.c
src/compiler/nir/nir_to_lcssa.c
src/intel/compiler/brw_nir_lower_scoped_barriers.c

index 7c1d159c3bdd40a285c376c70d950da30393c1f1..b8c7f8c5eff3e4ee3c1c1114701759b97d20a3d7 100644 (file)
@@ -1975,9 +1975,7 @@ nir_function_impl_lower_instructions(nir_function_impl *impl,
    if (progress) {
       nir_metadata_preserve(impl, preserved);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 61cf71e34604308c11a9e15d7baaa5112d0fe418..79ca329391b309b014ac497a1210d78a0e84219b 100644 (file)
@@ -1032,9 +1032,7 @@ nir_opt_deref_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index b1f83d6e03f9547363536a51f968c44c734a4f32..d7144b39a8d6744f0d6ac7a1e18615a53f8dff54 100644 (file)
@@ -143,9 +143,7 @@ inline_function_impl(nir_function_impl *impl, struct set *inlined)
 
       nir_metadata_preserve(impl, nir_metadata_none);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    _mesa_set_add(inlined, impl);
index 0766a1beb715101ba0848a9d4356c8dff63b83ca..99ed9ead73b7e9c551e0a9a2f382752e3f5ee08c 100644 (file)
@@ -162,6 +162,8 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index fbab2677756190829fc124515600424249eae7d4..38e3fa9c6c01dfa18ffed3f9649e559925e0a044 100644 (file)
@@ -106,6 +106,8 @@ lower_impl(nir_function_impl *impl,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index f3c343c444af4d59aff4640dadd2acc7684c909a..2bdab5fab837b7133613dc7ec121321d83fde26b 100644 (file)
@@ -154,6 +154,8 @@ nir_lower_bool_to_int32_impl(nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 73226fd62ef20ff6ffde222ae91e101cf9594e8b..138fddeea5afed853956083c2e09722532365070 100644 (file)
@@ -758,11 +758,9 @@ nir_lower_doubles_impl(nir_function_impl *impl,
    } else if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
-    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
-    }
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
+   }
 
    return progress;
 }
index 9efc511bcad440c3a30ea91d5df43f71b0f98959..563fa3960cca95cdb8de76685a5c72556df7da16 100644 (file)
@@ -108,13 +108,10 @@ nir_lower_global_vars_to_local(nir_shader *shader)
    if (progress)
       nir_fixup_deref_modes(shader);
 
-#ifndef NDEBUG
    nir_foreach_function(function, shader) {
-      if (function->impl) {
-         function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-      }
+      if (function->impl)
+         nir_metadata_preserve(function->impl, nir_metadata_all);
    }
-#endif
 
    return progress;
 }
index 9e8a844b534120b8c1b166fc115ab10c84bb8cab..d9dcba842988af15a1ba8ebd89c9df0a0031f410 100644 (file)
@@ -191,6 +191,8 @@ lower_indirects_impl(nir_function_impl *impl, nir_variable_mode modes)
 
    if (progress)
       nir_metadata_preserve(impl, nir_metadata_none);
+   else
+      nir_metadata_preserve(impl, nir_metadata_all);
 
    return progress;
 }
index a65dcb06d0cad68dc18b390ed2d8a8650e616391..197cebd695df06a88b0417132fff42cd6f495373 100644 (file)
@@ -81,9 +81,7 @@ nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index ba9f4bc040a866bcd51e0eb122771c13e8c8148f..ed95d46dd1e2ef80671efb915fa12dd9e9ee30b4 100644 (file)
@@ -138,12 +138,17 @@ lower_pack_impl(nir_function_impl *impl)
 
          nir_ssa_def_rewrite_uses(&alu_instr->dest.dest.ssa, nir_src_for_ssa(dest));
          nir_instr_remove(&alu_instr->instr);
-         nir_metadata_preserve(impl, nir_metadata_block_index |
-                                     nir_metadata_dominance);
          progress = true;
       }
    }
 
+   if (progress) {
+      nir_metadata_preserve(impl, nir_metadata_block_index |
+                                  nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
+   }
+
    return progress;
 }
 
index ecbbf43da3bc9d409d72ef4a29664778346ca4a5..56c7656aeafc7412fc7c41781087839c9eb166ca 100644 (file)
@@ -275,9 +275,7 @@ nir_lower_returns_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_none);
       nir_repair_ssa_impl(impl);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 0301afd3dcbe06a121be9d20f9af8f88dd86f749..1f102ac5b9a15e1882ca1e14b8b86922942f011b 100644 (file)
@@ -175,6 +175,8 @@ nir_lower_vars_to_scratch(nir_shader *shader,
          progress = true;
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index e6ade733ebace512711c207443016cd133aba7c7..f9df4446a14a8077eaa92b220aae7234c8178a80 100644 (file)
@@ -150,9 +150,7 @@ lower_var_copies_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index b2a17d0584b5ef5947440cb06f032f35006483af..3a32bbd053370d4af0b29d849ccaa17b701fee3f 100644 (file)
@@ -115,9 +115,7 @@ nir_lower_variable_initializers(nir_shader *shader, nir_variable_mode modes)
                                                nir_metadata_dominance |
                                                nir_metadata_live_ssa_defs);
       } else {
-#ifndef NDEBUG
-         function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index 0077ddf50f3680af30097cdb9f00f4ded32d7ca6..30870e6e35c41b239687d63fbdc70ee9774bba98 100644 (file)
@@ -750,9 +750,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
    }
 
    if (!progress) {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
       return false;
    }
 
index eec994f15e53881580659ecfcbce91713b0f5db2..64b3fb4b4216c274e2ce9673ef50b93e7be102f3 100644 (file)
@@ -295,6 +295,8 @@ nir_lower_vec_to_movs_impl(nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 49ab10511f88dd672555b408c9ab96a0ea62828b..18c3d790eb9e0d3d333ecf5a596fadb680c074f1 100644 (file)
@@ -58,6 +58,8 @@ nir_opt_combine_memory_barriers_impl(
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance |
                                   nir_metadata_live_ssa_defs);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 8295b0fd7a7c64d666cff4e310742f6ea809c676..08fa4ac4463b32705ee04dc5817f74be16e614d6 100644 (file)
@@ -400,6 +400,8 @@ combine_stores_impl(struct combine_stores_state *state, nir_function_impl *impl)
    if (state->progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return state->progress;
index 8e1a80338ed9dfaa18d8bd23ebf7b44fd16328ed..1bb62f3214532e9809b123190a933c0aa5c00aa4 100644 (file)
@@ -364,9 +364,12 @@ nir_opt_comparison_pre_impl(nir_function_impl *impl)
 
    block_queue_finish(&bq);
 
-   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;
 }
index 9964d78c105d0a36a7466e18913adbdfb4ef0059..9dcb464c72452f1fcb94fea128fba5c7c7d48500 100644 (file)
@@ -221,9 +221,7 @@ nir_opt_constant_folding_impl(struct constant_fold_state *state, nir_function_im
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index a1ea55cbfbf2abda3f402c11c39da51bc966e462..fddbf88daf9edc78af60ae2e6db310f8b7fa30f8 100644 (file)
@@ -1186,9 +1186,7 @@ nir_copy_prop_vars_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    ralloc_free(mem_ctx);
index 794d9bcf19dc4f21d90538f42faad03c107e34b2..2f7e4bc49f747f828ac3a7a993d93a67bfbabec1 100644 (file)
@@ -273,9 +273,7 @@ nir_copy_prop_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 3c3617d852a7b7845c9b08f27caa47e89f012de9..e9ca688950101e0673a8b2022ac88fac9e0d12d6 100644 (file)
@@ -74,9 +74,7 @@ nir_opt_cse_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    nir_instr_set_destroy(instr_set);
index 724cf3f20349277e86ab8ae167e2e75695b3cf38..c2487b026eac2b4c7c46c97fe27316ea13dc212b 100644 (file)
@@ -149,9 +149,7 @@ nir_opt_dce_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index a798da5d5881d9d9c6db1a86a999721d75131120..01d3699b84a1eecb0bf95fb29b65f38054e4cc70 100644 (file)
@@ -374,9 +374,7 @@ opt_dead_cf_impl(nir_function_impl *impl)
        */
       nir_repair_ssa_impl(impl);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index adba32ac31074b0614a1772fe10184546c0e0956..b9d167a878e795d21c0703db2326df647157d509 100644 (file)
@@ -243,6 +243,8 @@ remove_dead_write_vars_impl(void *mem_ctx, nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 7f3988417de54aba8799de5ae71d6a23a3a90dea..0739a1f3719b139e752bac31097a72fb67731a93 100644 (file)
@@ -589,6 +589,8 @@ opt_find_array_copies_impl(nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 688186779e6bf6162ecf34cb7e0adb9e9d539a0e..2992d06031788472a26a0692e47ad1eee94e9123 100644 (file)
@@ -198,6 +198,8 @@ nir_opt_idiv_const_impl(nir_function_impl *impl, unsigned min_bit_size)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index e07e852f8695b69258c9a58f261ec31dfc622cd3..9c32ab1cc57b16378cb1d2bdccfd8bf6e5a10d5a 100644 (file)
@@ -1451,9 +1451,7 @@ nir_opt_if(nir_shader *shader, bool aggressive_last_continue)
       if (preserve) {
          nir_metadata_preserve(function->impl, nir_metadata_none);
       } else {
-   #ifndef NDEBUG
-         function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-   #endif
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index e185602bf9e083e9eb90d1b32e7672cfc1e4ab91..503462ecfbe545fb12c62dd39992b330e46e3a64 100644 (file)
@@ -121,6 +121,8 @@ nir_opt_intrinsics(nir_shader *shader)
          progress = true;
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index 18c549804d03edbad60e43d50a615c73eda361a7..8abdaf364f55d35ddce4be55fc6a6bf50269e461 100644 (file)
@@ -152,13 +152,19 @@ nir_opt_move(nir_shader *shader, nir_move_options options)
       if (!func->impl)
          continue;
 
+      bool impl_progress = false;
       nir_foreach_block(block, func->impl) {
-         if (move(block, options)) {
-            nir_metadata_preserve(func->impl, nir_metadata_block_index |
-                                              nir_metadata_dominance |
-                                              nir_metadata_live_ssa_defs);
-            progress = true;
-         }
+         if (move(block, options))
+            impl_progress = true;
+      }
+
+      if (impl_progress) {
+         nir_metadata_preserve(func->impl, nir_metadata_block_index |
+                                           nir_metadata_dominance |
+                                           nir_metadata_live_ssa_defs);
+         progress = true;
+      } else {
+         nir_metadata_preserve(func->impl, nir_metadata_all);
       }
    }
 
index 1d0636d44020e1c3efb8a8107105fb8851c75f77..590fec82405171a7ec7990168d4d387afeca7195 100644 (file)
@@ -306,9 +306,7 @@ nir_opt_peephole_select_impl(nir_function_impl *impl, unsigned limit,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_none);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 8af33ab436ee141b698b780b12fe686999312b9d..9647e361598a344a8575b148edb7970991aa87df 100644 (file)
@@ -174,6 +174,8 @@ nir_opt_rematerialize_compares_impl(nir_shader *shader, nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 36e01ff724541944366beb7a227fc816d58fc142..966a982516e3c4c5a52ca3f98ff2a737e2c2f421 100644 (file)
@@ -161,9 +161,7 @@ nir_opt_remove_phis_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 54d2245bccb0c735ee622fa5183815c6d8b2bd42..496811965acd94ab1216361cc7d3d6a0c67d3a8c 100644 (file)
@@ -130,6 +130,8 @@ nir_opt_trivial_continues(nir_shader *shader)
          /* If that made progress, we're no longer really in SSA form. */
          nir_lower_regs_to_ssa_impl(function->impl);
          progress = true;
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index 6342377ba620d2fb07b325b1dbf38a1ce1edda91..0edd7ae6ee0af8776aab42607fac3db588c2336e 100644 (file)
@@ -155,9 +155,7 @@ nir_opt_undef(nir_shader *shader)
                                   nir_metadata_block_index |
                                   nir_metadata_dominance);
          } else {
-#ifndef NDEBUG
-            function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+            nir_metadata_preserve(function->impl, nir_metadata_all);
          }
       }
    }
index 5435bbb78e6dce3201ee02996dc33ac35455a16a..09dd4c341e424eb14de12bfa504b4c3b890d0915 100644 (file)
@@ -960,11 +960,9 @@ nir_algebraic_impl(nir_function_impl *impl,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
-    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
-    }
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
+   }
 
    return progress;
 }
index 10b71c16c1799e6ea6aaf805f2496140785beb29..f3cde31a3555524ce038067ae93df4cf04aeaa14 100644 (file)
@@ -121,9 +121,7 @@ split_var_copies_impl(nir_function_impl *impl)
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
    } else {
-#ifndef NDEBUG
-      impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;
index 5b46d072a7abe73918413fa4ae9f883deac1c8a8..93b5e15e8df11dae51c7ea151ef19d1a8d64fd2c 100644 (file)
@@ -331,6 +331,8 @@ nir_split_struct_vars(nir_shader *shader, nir_variable_mode modes)
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
          progress = true;
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
@@ -914,6 +916,8 @@ nir_split_array_vars(nir_shader *shader, nir_variable_mode modes)
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
          progress = true;
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
@@ -1654,6 +1658,8 @@ nir_shrink_vec_array_vars(nir_shader *shader, nir_variable_mode modes)
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
          progress = true;
+      } else {
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index e5b760c706f6f010c69221ce72796c19849fb83f..64e260fe3b234697ecaf3c7a9821497a295a8102 100644 (file)
@@ -397,9 +397,7 @@ nir_convert_to_lcssa(nir_shader *shader, bool skip_invariants, bool skip_bool_in
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
       } else {
-#ifndef NDEBUG
-         function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+         nir_metadata_preserve(function->impl, nir_metadata_all);
       }
    }
 
index bc78ff1985f6de2c8065a5fa77b6f271f5c0dc5a..50ab3566cf7e5a905dd3f7588dd04bb015f66411 100644 (file)
@@ -64,6 +64,8 @@ lower_impl(nir_function_impl *impl)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
    }
 
    return progress;