Mesa (main): nir/builder: invalidate metadata per function
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 11 11:56:54 UTC 2021
Module: Mesa
Branch: main
Commit: e1b325f58730d8fd82829c538c9e83aa193c4eba
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e1b325f58730d8fd82829c538c9e83aa193c4eba
Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date: Fri Aug 6 12:14:38 2021 +0200
nir/builder: invalidate metadata per function
Fixes: a62098fff20 ("nir: Add a helper for general instruction-modifying passes.")
Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
---
src/compiler/nir/nir_builder.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index e778f0e73c8..b1def3e996c 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -103,17 +103,19 @@ nir_shader_instructions_pass(nir_shader *shader,
if (!function->impl)
continue;
+ bool func_progress = false;
nir_builder b;
nir_builder_init(&b, function->impl);
nir_foreach_block_safe(block, function->impl) {
nir_foreach_instr_safe(instr, block) {
- progress |= pass(&b, instr, cb_data);
+ func_progress |= pass(&b, instr, cb_data);
}
}
- if (progress) {
+ if (func_progress) {
nir_metadata_preserve(function->impl, preserved);
+ progress = true;
} else {
nir_metadata_preserve(function->impl, nir_metadata_all);
}
More information about the mesa-commit
mailing list