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

Connor Abbott cwabbott0 at gmail.com
Wed Apr 13 04:34:50 UTC 2016


Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
---
 src/compiler/nir/nir_lower_load_const_to_scalar.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/compiler/nir/nir_lower_load_const_to_scalar.c b/src/compiler/nir/nir_lower_load_const_to_scalar.c
index b5df464..feb5dfb 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -62,21 +62,15 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)
    nir_instr_remove(&lower->instr);
 }
 
-static bool
-lower_load_const_to_scalar_block(nir_block *block, void *data)
-{
-   nir_foreach_instr_safe(block, instr) {
-      if (instr->type == nir_instr_type_load_const)
-         lower_load_const_instr_scalar(nir_instr_as_load_const(instr));
-   }
-
-   return true;
-}
-
 static void
 nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
 {
-   nir_foreach_block(impl, lower_load_const_to_scalar_block, NULL);
+   nir_foreach_block(impl, block) {
+      nir_foreach_instr_safe(block, instr) {
+         if (instr->type == nir_instr_type_load_const)
+            lower_load_const_instr_scalar(nir_instr_as_load_const(instr));
+      }
+   }
 }
 
 void
-- 
2.5.0



More information about the mesa-dev mailing list