Mesa (main): nir/opt_shrink_vectors: reverse iteration order

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 26 09:59:26 UTC 2021


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Wed Jun 16 09:20:01 2021 +0200

nir/opt_shrink_vectors: reverse iteration order

This pass should be backwards in order to reach the fixed point
in linear time.

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11411>

---

 src/compiler/nir/nir_opt_shrink_vectors.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_opt_shrink_vectors.c b/src/compiler/nir/nir_opt_shrink_vectors.c
index 6aa4bd59bd3..45284dc493b 100644
--- a/src/compiler/nir/nir_opt_shrink_vectors.c
+++ b/src/compiler/nir/nir_opt_shrink_vectors.c
@@ -258,8 +258,8 @@ nir_opt_shrink_vectors(nir_shader *shader, bool shrink_image_store)
       nir_builder b;
       nir_builder_init(&b, function->impl);
 
-      nir_foreach_block(block, function->impl) {
-         nir_foreach_instr(instr, block) {
+      nir_foreach_block_reverse(block, function->impl) {
+         nir_foreach_instr_reverse(instr, block) {
             progress |= opt_shrink_vectors_instr(&b, instr, shrink_image_store);
          }
       }



More information about the mesa-commit mailing list