We can't preserve dominance or live variable information.

This also begs the question: what about globals?  Metadata only exists
at the nir_function_impl level, so it would seem there is no metadata
about global variables for us to invalidate.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/glsl/nir/nir_remove_dead_variables.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/glsl/nir/nir_remove_dead_variables.c 
b/src/glsl/nir/nir_remove_dead_variables.c
index d6783e7..77b6c13 100644
--- a/src/glsl/nir/nir_remove_dead_variables.c
+++ b/src/glsl/nir/nir_remove_dead_variables.c
@@ -126,8 +126,13 @@ nir_remove_dead_variables(nir_shader *shader)
    progress = remove_dead_vars(&shader->globals, live) || progress;
 
    nir_foreach_overload(shader, overload) {
-      if (overload->impl)
-         progress = remove_dead_vars(&overload->impl->locals, live) || 
progress;
+      if (overload->impl) {
+         if (remove_dead_vars(&overload->impl->locals, live)) {
+            nir_metadata_preserve(overload->impl, nir_metadata_block_index |
+                                                  nir_metadata_dominance);
+            progress = true;
+         }
+      }
    }
 
    _mesa_set_destroy(live, NULL);
-- 
2.6.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to