Mesa (main): nir: Preserve metadata if remove_dead_derefs makes no progress

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 13 23:17:31 UTC 2022


Module: Mesa
Branch: main
Commit: c23b20d43a03634bf528f9870cdd5b0159a69eb4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c23b20d43a03634bf528f9870cdd5b0159a69eb4

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Thu May 12 13:59:30 2022 -0500

nir: Preserve metadata if remove_dead_derefs makes no progress

Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482>

---

 src/compiler/nir/nir_deref.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 90ad90d6763..4faad2657ca 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -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;
 }



More information about the mesa-commit mailing list