aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-05-21 20:41:12 -0500
committerMarge Bot <[email protected]>2020-06-11 05:08:12 +0000
commit5e1c42d85f2d89faddbc91be94b35044b29df847 (patch)
treecba107f062451b0534c92035aa8eb60f8578c932
parentb0d1f9a72ff6e1c7164dc22ff5eb3e817f245d13 (diff)
nir: Call nir_metadata_preserve on !progress
Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
-rw-r--r--src/compiler/nir/nir.c4
-rw-r--r--src/compiler/nir/nir_deref.c4
-rw-r--r--src/compiler/nir/nir_inline_functions.c4
-rw-r--r--src/compiler/nir/nir_lower_array_deref_of_vec.c2
-rw-r--r--src/compiler/nir/nir_lower_bit_size.c2
-rw-r--r--src/compiler/nir/nir_lower_bool_to_int32.c2
-rw-r--r--src/compiler/nir/nir_lower_double_ops.c8
-rw-r--r--src/compiler/nir/nir_lower_global_vars_to_local.c7
-rw-r--r--src/compiler/nir/nir_lower_indirect_derefs.c2
-rw-r--r--src/compiler/nir/nir_lower_load_const_to_scalar.c4
-rw-r--r--src/compiler/nir/nir_lower_packing.c9
-rw-r--r--src/compiler/nir/nir_lower_returns.c4
-rw-r--r--src/compiler/nir/nir_lower_scratch.c2
-rw-r--r--src/compiler/nir/nir_lower_var_copies.c4
-rw-r--r--src/compiler/nir/nir_lower_variable_initializers.c4
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c4
-rw-r--r--src/compiler/nir/nir_lower_vec_to_movs.c2
-rw-r--r--src/compiler/nir/nir_opt_barriers.c2
-rw-r--r--src/compiler/nir/nir_opt_combine_stores.c2
-rw-r--r--src/compiler/nir/nir_opt_comparison_pre.c5
-rw-r--r--src/compiler/nir/nir_opt_constant_folding.c4
-rw-r--r--src/compiler/nir/nir_opt_copy_prop_vars.c4
-rw-r--r--src/compiler/nir/nir_opt_copy_propagate.c4
-rw-r--r--src/compiler/nir/nir_opt_cse.c4
-rw-r--r--src/compiler/nir/nir_opt_dce.c4
-rw-r--r--src/compiler/nir/nir_opt_dead_cf.c4
-rw-r--r--src/compiler/nir/nir_opt_dead_write_vars.c2
-rw-r--r--src/compiler/nir/nir_opt_find_array_copies.c2
-rw-r--r--src/compiler/nir/nir_opt_idiv_const.c2
-rw-r--r--src/compiler/nir/nir_opt_if.c4
-rw-r--r--src/compiler/nir/nir_opt_intrinsics.c2
-rw-r--r--src/compiler/nir/nir_opt_move.c18
-rw-r--r--src/compiler/nir/nir_opt_peephole_select.c4
-rw-r--r--src/compiler/nir/nir_opt_rematerialize_compares.c2
-rw-r--r--src/compiler/nir/nir_opt_remove_phis.c4
-rw-r--r--src/compiler/nir/nir_opt_trivial_continues.c2
-rw-r--r--src/compiler/nir/nir_opt_undef.c4
-rw-r--r--src/compiler/nir/nir_search.c8
-rw-r--r--src/compiler/nir/nir_split_var_copies.c4
-rw-r--r--src/compiler/nir/nir_split_vars.c6
-rw-r--r--src/compiler/nir/nir_to_lcssa.c4
-rw-r--r--src/intel/compiler/brw_nir_lower_scoped_barriers.c2
42 files changed, 87 insertions, 84 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 7c1d159c3bd..b8c7f8c5eff 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -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;
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 61cf71e3460..79ca329391b 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -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;
diff --git a/src/compiler/nir/nir_inline_functions.c b/src/compiler/nir/nir_inline_functions.c
index b1f83d6e03f..d7144b39a8d 100644
--- a/src/compiler/nir/nir_inline_functions.c
+++ b/src/compiler/nir/nir_inline_functions.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_array_deref_of_vec.c b/src/compiler/nir/nir_lower_array_deref_of_vec.c
index 0766a1beb71..99ed9ead73b 100644
--- a/src/compiler/nir/nir_lower_array_deref_of_vec.c
+++ b/src/compiler/nir/nir_lower_array_deref_of_vec.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_bit_size.c b/src/compiler/nir/nir_lower_bit_size.c
index fbab2677756..38e3fa9c6c0 100644
--- a/src/compiler/nir/nir_lower_bit_size.c
+++ b/src/compiler/nir/nir_lower_bit_size.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_bool_to_int32.c b/src/compiler/nir/nir_lower_bool_to_int32.c
index f3c343c444a..2bdab5fab83 100644
--- a/src/compiler/nir/nir_lower_bool_to_int32.c
+++ b/src/compiler/nir/nir_lower_bool_to_int32.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c
index 73226fd62ef..138fddeea5a 100644
--- a/src/compiler/nir/nir_lower_double_ops.c
+++ b/src/compiler/nir/nir_lower_double_ops.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_lower_global_vars_to_local.c b/src/compiler/nir/nir_lower_global_vars_to_local.c
index 9efc511bcad..563fa3960cc 100644
--- a/src/compiler/nir/nir_lower_global_vars_to_local.c
+++ b/src/compiler/nir/nir_lower_global_vars_to_local.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c
index 9e8a844b534..d9dcba84298 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_lower_load_const_to_scalar.c b/src/compiler/nir/nir_lower_load_const_to_scalar.c
index a65dcb06d0c..197cebd695d 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_packing.c b/src/compiler/nir/nir_lower_packing.c
index ba9f4bc040a..ed95d46dd1e 100644
--- a/src/compiler/nir/nir_lower_packing.c
+++ b/src/compiler/nir/nir_lower_packing.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_lower_returns.c b/src/compiler/nir/nir_lower_returns.c
index ecbbf43da3b..56c7656aeaf 100644
--- a/src/compiler/nir/nir_lower_returns.c
+++ b/src/compiler/nir/nir_lower_returns.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_scratch.c b/src/compiler/nir/nir_lower_scratch.c
index 0301afd3dcb..1f102ac5b9a 100644
--- a/src/compiler/nir/nir_lower_scratch.c
+++ b/src/compiler/nir/nir_lower_scratch.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c
index e6ade733eba..f9df4446a14 100644
--- a/src/compiler/nir/nir_lower_var_copies.c
+++ b/src/compiler/nir/nir_lower_var_copies.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_variable_initializers.c b/src/compiler/nir/nir_lower_variable_initializers.c
index b2a17d0584b..3a32bbd0533 100644
--- a/src/compiler/nir/nir_lower_variable_initializers.c
+++ b/src/compiler/nir/nir_lower_variable_initializers.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index 0077ddf50f3..30870e6e35c 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_lower_vec_to_movs.c b/src/compiler/nir/nir_lower_vec_to_movs.c
index eec994f15e5..64b3fb4b421 100644
--- a/src/compiler/nir/nir_lower_vec_to_movs.c
+++ b/src/compiler/nir/nir_lower_vec_to_movs.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_barriers.c b/src/compiler/nir/nir_opt_barriers.c
index 49ab10511f8..18c3d790eb9 100644
--- a/src/compiler/nir/nir_opt_barriers.c
+++ b/src/compiler/nir/nir_opt_barriers.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c
index 8295b0fd7a7..08fa4ac4463 100644
--- a/src/compiler/nir/nir_opt_combine_stores.c
+++ b/src/compiler/nir/nir_opt_combine_stores.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_comparison_pre.c b/src/compiler/nir/nir_opt_comparison_pre.c
index 8e1a80338ed..1bb62f32145 100644
--- a/src/compiler/nir/nir_opt_comparison_pre.c
+++ b/src/compiler/nir/nir_opt_comparison_pre.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index 9964d78c105..9dcb464c724 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c
index a1ea55cbfbf..fddbf88daf9 100644
--- a/src/compiler/nir/nir_opt_copy_prop_vars.c
+++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
@@ -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);
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index 794d9bcf19d..2f7e4bc49f7 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_cse.c b/src/compiler/nir/nir_opt_cse.c
index 3c3617d852a..e9ca6889501 100644
--- a/src/compiler/nir/nir_opt_cse.c
+++ b/src/compiler/nir/nir_opt_cse.c
@@ -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);
diff --git a/src/compiler/nir/nir_opt_dce.c b/src/compiler/nir/nir_opt_dce.c
index 724cf3f2034..c2487b026ea 100644
--- a/src/compiler/nir/nir_opt_dce.c
+++ b/src/compiler/nir/nir_opt_dce.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c
index a798da5d588..01d3699b84a 100644
--- a/src/compiler/nir/nir_opt_dead_cf.c
+++ b/src/compiler/nir/nir_opt_dead_cf.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_dead_write_vars.c b/src/compiler/nir/nir_opt_dead_write_vars.c
index adba32ac310..b9d167a878e 100644
--- a/src/compiler/nir/nir_opt_dead_write_vars.c
+++ b/src/compiler/nir/nir_opt_dead_write_vars.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_find_array_copies.c b/src/compiler/nir/nir_opt_find_array_copies.c
index 7f3988417de..0739a1f3719 100644
--- a/src/compiler/nir/nir_opt_find_array_copies.c
+++ b/src/compiler/nir/nir_opt_find_array_copies.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_idiv_const.c b/src/compiler/nir/nir_opt_idiv_const.c
index 688186779e6..2992d060317 100644
--- a/src/compiler/nir/nir_opt_idiv_const.c
+++ b/src/compiler/nir/nir_opt_idiv_const.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c
index e07e852f869..9c32ab1cc57 100644
--- a/src/compiler/nir/nir_opt_if.c
+++ b/src/compiler/nir/nir_opt_if.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_opt_intrinsics.c b/src/compiler/nir/nir_opt_intrinsics.c
index e185602bf9e..503462ecfbe 100644
--- a/src/compiler/nir/nir_opt_intrinsics.c
+++ b/src/compiler/nir/nir_opt_intrinsics.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_opt_move.c b/src/compiler/nir/nir_opt_move.c
index 18c549804d0..8abdaf364f5 100644
--- a/src/compiler/nir/nir_opt_move.c
+++ b/src/compiler/nir/nir_opt_move.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c
index 1d0636d4402..590fec82405 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_rematerialize_compares.c b/src/compiler/nir/nir_opt_rematerialize_compares.c
index 8af33ab436e..9647e361598 100644
--- a/src/compiler/nir/nir_opt_rematerialize_compares.c
+++ b/src/compiler/nir/nir_opt_rematerialize_compares.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c
index 36e01ff7245..966a982516e 100644
--- a/src/compiler/nir/nir_opt_remove_phis.c
+++ b/src/compiler/nir/nir_opt_remove_phis.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_trivial_continues.c b/src/compiler/nir/nir_opt_trivial_continues.c
index 54d2245bccb..496811965ac 100644
--- a/src/compiler/nir/nir_opt_trivial_continues.c
+++ b/src/compiler/nir/nir_opt_trivial_continues.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
index 6342377ba62..0edd7ae6ee0 100644
--- a/src/compiler/nir/nir_opt_undef.c
+++ b/src/compiler/nir/nir_opt_undef.c
@@ -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);
}
}
}
diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index 5435bbb78e6..09dd4c341e4 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -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;
}
diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c
index 10b71c16c17..f3cde31a355 100644
--- a/src/compiler/nir/nir_split_var_copies.c
+++ b/src/compiler/nir/nir_split_var_copies.c
@@ -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;
diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c
index 5b46d072a7a..93b5e15e8df 100644
--- a/src/compiler/nir/nir_split_vars.c
+++ b/src/compiler/nir/nir_split_vars.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c
index e5b760c706f..64e260fe3b2 100644
--- a/src/compiler/nir/nir_to_lcssa.c
+++ b/src/compiler/nir/nir_to_lcssa.c
@@ -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);
}
}
diff --git a/src/intel/compiler/brw_nir_lower_scoped_barriers.c b/src/intel/compiler/brw_nir_lower_scoped_barriers.c
index bc78ff1985f..50ab3566cf7 100644
--- a/src/intel/compiler/brw_nir_lower_scoped_barriers.c
+++ b/src/intel/compiler/brw_nir_lower_scoped_barriers.c
@@ -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;