From 8317fe314c992b5bd70e80721176d4d89954eb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 16 Jun 2021 09:20:01 +0200 Subject: [PATCH] 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 Part-of: --- 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); } }