Mesa (main): nir: preserve all metadata when nir_opt_vectorize doesn't make progress

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 5 10:29:40 UTC 2021


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

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Tue Aug 10 12:46:55 2021 +0200

nir: preserve all metadata when nir_opt_vectorize doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

---

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

diff --git a/src/compiler/nir/nir_opt_vectorize.c b/src/compiler/nir/nir_opt_vectorize.c
index 2f4acafa3c7..83c841ee63e 100644
--- a/src/compiler/nir/nir_opt_vectorize.c
+++ b/src/compiler/nir/nir_opt_vectorize.c
@@ -420,9 +420,12 @@ nir_opt_vectorize_impl(struct nir_shader *nir, nir_function_impl *impl,
    bool progress = vectorize_block(nir, nir_start_block(impl), instr_set,
                                    filter, data);
 
-   if (progress)
+   if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance);
+   } else {
+      nir_metadata_preserve(impl, nir_metadata_all);
+   }
 
    vec_instr_set_destroy(instr_set);
    return progress;



More information about the mesa-commit mailing list