[Mesa-dev] [PATCH 21/47] nir/lower_idiv: fixup for new foreach_block()

Connor Abbott cwabbott0 at gmail.com
Wed Apr 13 04:35:00 UTC 2016


Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
---
 src/compiler/nir/nir_lower_idiv.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c
index a084ad9..a56b1f5 100644
--- a/src/compiler/nir/nir_lower_idiv.c
+++ b/src/compiler/nir/nir_lower_idiv.c
@@ -117,26 +117,19 @@ convert_instr(nir_builder *bld, nir_alu_instr *alu)
    nir_ssa_def_rewrite_uses(&alu->dest.dest.ssa, nir_src_for_ssa(q));
 }
 
-static bool
-convert_block(nir_block *block, void *state)
-{
-   nir_builder *b = state;
-
-   nir_foreach_instr_safe(block, instr) {
-      if (instr->type == nir_instr_type_alu)
-         convert_instr(b, nir_instr_as_alu(instr));
-   }
-
-   return true;
-}
-
 static void
 convert_impl(nir_function_impl *impl)
 {
    nir_builder b;
    nir_builder_init(&b, impl);
 
-   nir_foreach_block(impl, convert_block, &b);
+   nir_foreach_block(impl, block) {
+      nir_foreach_instr_safe(block, instr) {
+         if (instr->type == nir_instr_type_alu)
+            convert_instr(&b, nir_instr_as_alu(instr));
+      }
+   }
+
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
 }
-- 
2.5.0



More information about the mesa-dev mailing list