nir: rename nir_foreach_block*() to nir_foreach_block*_call()
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 13 Apr 2016 20:25:34 +0000 (16:25 -0400)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 20 Apr 2016 16:47:05 +0000 (09:47 -0700)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
59 files changed:
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_algebraic.py
src/compiler/nir/nir_dominance.c
src/compiler/nir/nir_from_ssa.c
src/compiler/nir/nir_gather_info.c
src/compiler/nir/nir_inline_functions.c
src/compiler/nir/nir_liveness.c
src/compiler/nir/nir_lower_alu_to_scalar.c
src/compiler/nir/nir_lower_atomics.c
src/compiler/nir/nir_lower_clip.c
src/compiler/nir/nir_lower_double_packing.c
src/compiler/nir/nir_lower_global_vars_to_local.c
src/compiler/nir/nir_lower_gs_intrinsics.c
src/compiler/nir/nir_lower_idiv.c
src/compiler/nir/nir_lower_indirect_derefs.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_load_const_to_scalar.c
src/compiler/nir/nir_lower_locals_to_regs.c
src/compiler/nir/nir_lower_outputs_to_temporaries.c
src/compiler/nir/nir_lower_phis_to_scalar.c
src/compiler/nir/nir_lower_samplers.c
src/compiler/nir/nir_lower_system_values.c
src/compiler/nir/nir_lower_tex.c
src/compiler/nir/nir_lower_to_source_mods.c
src/compiler/nir/nir_lower_two_sided_color.c
src/compiler/nir/nir_lower_var_copies.c
src/compiler/nir/nir_lower_vars_to_ssa.c
src/compiler/nir/nir_lower_vec_to_movs.c
src/compiler/nir/nir_move_vec_src_uses_to_dest.c
src/compiler/nir/nir_normalize_cubemap_coords.c
src/compiler/nir/nir_opt_constant_folding.c
src/compiler/nir/nir_opt_copy_propagate.c
src/compiler/nir/nir_opt_dce.c
src/compiler/nir/nir_opt_dead_cf.c
src/compiler/nir/nir_opt_gcm.c
src/compiler/nir/nir_opt_peephole_select.c
src/compiler/nir/nir_opt_remove_phis.c
src/compiler/nir/nir_opt_undef.c
src/compiler/nir/nir_phi_builder.c
src/compiler/nir/nir_remove_dead_variables.c
src/compiler/nir/nir_repair_ssa.c
src/compiler/nir/nir_split_var_copies.c
src/compiler/nir/nir_validate.c
src/compiler/nir/nir_worklist.c
src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
src/gallium/drivers/vc4/vc4_nir_lower_blend.c
src/gallium/drivers/vc4/vc4_nir_lower_io.c
src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c
src/gallium/drivers/vc4/vc4_program.c
src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_nir_lower_push_constants.c
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_nir.c
src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c
src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c
src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index 8d38d3384d888c1b007ee2eea4eb16e4db5e36c4..5cafc41ec81e19caa4b94c9dd08abc72d49750a8 100644 (file)
@@ -1549,14 +1549,14 @@ foreach_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
 }
 
 bool
-nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
+nir_foreach_block_in_cf_node_call(nir_cf_node *node, nir_foreach_block_cb cb,
                              void *state)
 {
    return foreach_cf_node(node, cb, false, state);
 }
 
 bool
-nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
+nir_foreach_block_call(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
 {
    foreach_list_typed_safe(nir_cf_node, node, node, &impl->body) {
       if (!foreach_cf_node(node, cb, false, state))
@@ -1567,7 +1567,7 @@ nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
 }
 
 bool
-nir_foreach_block_reverse(nir_function_impl *impl, nir_foreach_block_cb cb,
+nir_foreach_block_reverse_call(nir_function_impl *impl, nir_foreach_block_cb cb,
                           void *state)
 {
    if (!cb(impl->end_block, state))
@@ -1630,7 +1630,7 @@ nir_index_blocks(nir_function_impl *impl)
    if (impl->valid_metadata & nir_metadata_block_index)
       return;
 
-   nir_foreach_block(impl, index_block, &index);
+   nir_foreach_block_call(impl, index_block, &index);
 
    impl->num_blocks = index;
 }
@@ -1661,7 +1661,7 @@ void
 nir_index_ssa_defs(nir_function_impl *impl)
 {
    unsigned index = 0;
-   nir_foreach_block(impl, index_ssa_block, &index);
+   nir_foreach_block_call(impl, index_ssa_block, &index);
    impl->ssa_alloc = index;
 }
 
@@ -1683,7 +1683,7 @@ unsigned
 nir_index_instrs(nir_function_impl *impl)
 {
    unsigned index = 0;
-   nir_foreach_block(impl, index_instrs_block, &index);
+   nir_foreach_block_call(impl, index_instrs_block, &index);
    return index;
 }
 
index 3b82cfac1b52c23025caf609200441c47a44774a..4693ab58a598e05b53a16f6b2b3f1a4168ef7e40 100644 (file)
@@ -2121,11 +2121,11 @@ void nir_ssa_def_rewrite_uses_after(nir_ssa_def *def, nir_src new_src,
 
 /* visits basic blocks in source-code order */
 typedef bool (*nir_foreach_block_cb)(nir_block *block, void *state);
-bool nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb,
+bool nir_foreach_block_call(nir_function_impl *impl, nir_foreach_block_cb cb,
                        void *state);
-bool nir_foreach_block_reverse(nir_function_impl *impl, nir_foreach_block_cb cb,
+bool nir_foreach_block_reverse_call(nir_function_impl *impl, nir_foreach_block_cb cb,
                                void *state);
-bool nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
+bool nir_foreach_block_in_cf_node_call(nir_cf_node *node, nir_foreach_block_cb cb,
                                   void *state);
 
 /* If the following CF node is an if, this function returns that if.
index 53a79073a447db02bb464b9496fe1535ef46bd57..76971714260e2abea372e1480bdd2903fcc61f08 100644 (file)
@@ -275,7 +275,7 @@ ${pass_name}_impl(nir_function_impl *impl, const bool *condition_flags)
    state.progress = false;
    state.condition_flags = condition_flags;
 
-   nir_foreach_block_reverse(impl, ${pass_name}_block, &state);
+   nir_foreach_block_reverse_call(impl, ${pass_name}_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_block_index |
index d95f396807458afba64a405067b7a9e35fa1fe2d..0abfcd29609e3f8e11a5ccfdf97efd3579a2ae0c 100644 (file)
@@ -176,9 +176,9 @@ calc_dom_children(nir_function_impl* impl)
 {
    void *mem_ctx = ralloc_parent(impl);
 
-   nir_foreach_block(impl, block_count_children, NULL);
-   nir_foreach_block(impl, block_alloc_children, mem_ctx);
-   nir_foreach_block(impl, block_add_child, NULL);
+   nir_foreach_block_call(impl, block_count_children, NULL);
+   nir_foreach_block_call(impl, block_alloc_children, mem_ctx);
+   nir_foreach_block_call(impl, block_add_child, NULL);
 }
 
 static void
@@ -204,14 +204,14 @@ nir_calc_dominance_impl(nir_function_impl *impl)
    state.impl = impl;
    state.progress = true;
 
-   nir_foreach_block(impl, init_block_cb, &state);
+   nir_foreach_block_call(impl, init_block_cb, &state);
 
    while (state.progress) {
       state.progress = false;
-      nir_foreach_block(impl, calc_dominance_cb, &state);
+      nir_foreach_block_call(impl, calc_dominance_cb, &state);
    }
 
-   nir_foreach_block(impl, calc_dom_frontier_cb, &state);
+   nir_foreach_block_call(impl, calc_dom_frontier_cb, &state);
 
    nir_block *start_block = nir_start_block(impl);
    start_block->imm_dom = NULL;
@@ -282,7 +282,7 @@ void
 nir_dump_dom_tree_impl(nir_function_impl *impl, FILE *fp)
 {
    fprintf(fp, "digraph doms_%s {\n", impl->function->name);
-   nir_foreach_block(impl, dump_block_dom, fp);
+   nir_foreach_block_call(impl, dump_block_dom, fp);
    fprintf(fp, "}\n\n");
 }
 
@@ -313,7 +313,7 @@ dump_block_dom_frontier(nir_block *block, void *state)
 void
 nir_dump_dom_frontier_impl(nir_function_impl *impl, FILE *fp)
 {
-   nir_foreach_block(impl, dump_block_dom_frontier, fp);
+   nir_foreach_block_call(impl, dump_block_dom_frontier, fp);
 }
 
 void
@@ -340,7 +340,7 @@ void
 nir_dump_cfg_impl(nir_function_impl *impl, FILE *fp)
 {
    fprintf(fp, "digraph cfg_%s {\n", impl->function->name);
-   nir_foreach_block(impl, dump_block_succs, fp);
+   nir_foreach_block_call(impl, dump_block_succs, fp);
    fprintf(fp, "}\n\n");
 }
 
index 7bbc2c0f299a37975be7f773dede9be460e34be1..b24d60633a43ebbf05a3aebd5380c1f11cc3b7b7 100644 (file)
@@ -774,8 +774,8 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only)
    state.merge_node_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
                                                     _mesa_key_pointer_equal);
 
-   nir_foreach_block(impl, add_parallel_copy_to_end_of_block, &state);
-   nir_foreach_block(impl, isolate_phi_nodes_block, &state);
+   nir_foreach_block_call(impl, add_parallel_copy_to_end_of_block, &state);
+   nir_foreach_block_call(impl, isolate_phi_nodes_block, &state);
 
    /* Mark metadata as dirty before we ask for liveness analysis */
    nir_metadata_preserve(impl, nir_metadata_block_index |
@@ -784,12 +784,12 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only)
    nir_metadata_require(impl, nir_metadata_live_ssa_defs |
                               nir_metadata_dominance);
 
-   nir_foreach_block(impl, coalesce_phi_nodes_block, &state);
-   nir_foreach_block(impl, aggressive_coalesce_block, &state);
+   nir_foreach_block_call(impl, coalesce_phi_nodes_block, &state);
+   nir_foreach_block_call(impl, aggressive_coalesce_block, &state);
 
-   nir_foreach_block(impl, resolve_registers_block, &state);
+   nir_foreach_block_call(impl, resolve_registers_block, &state);
 
-   nir_foreach_block(impl, resolve_parallel_copies_block, &state);
+   nir_foreach_block_call(impl, resolve_parallel_copies_block, &state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index bff235bb3775f4f788694aee0fc933c72f6b5889..14da78d8cf7e29077d37f9c6c5d5a243d93edc9b 100644 (file)
@@ -157,5 +157,5 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
       }
    }
 
-   nir_foreach_block(entrypoint, gather_info_block, shader);
+   nir_foreach_block_call(entrypoint, gather_info_block, shader);
 }
index 4a08dcc96e0cab90df10a8c7b1be2fd0e66683ef..30221326dfed28567d5acfb1bc65feef8e2e05c4 100644 (file)
@@ -181,7 +181,7 @@ inline_functions_block(nir_block *block, void *void_state)
        */
 
       /* Figure out when we need to lower to a shadow local */
-      nir_foreach_block(callee_copy, lower_params_to_locals_block, callee_copy);
+      nir_foreach_block_call(callee_copy, lower_params_to_locals_block, callee_copy);
       for (unsigned i = 0; i < callee_copy->num_params; i++) {
          nir_variable *param = callee_copy->params[i];
 
@@ -192,7 +192,7 @@ inline_functions_block(nir_block *block, void *void_state)
          }
       }
 
-      nir_foreach_block(callee_copy, rewrite_param_derefs_block, call);
+      nir_foreach_block_call(callee_copy, rewrite_param_derefs_block, call);
 
       /* Pluck the body out of the function and place it here */
       nir_cf_list body;
@@ -237,7 +237,7 @@ inline_function_impl(nir_function_impl *impl, struct set *inlined)
    state.progress = false;
    nir_builder_init(&state.builder, impl);
 
-   nir_foreach_block(impl, inline_functions_block, &state);
+   nir_foreach_block_call(impl, inline_functions_block, &state);
 
    if (state.progress) {
       /* SSA and register indices are completely messed up now */
index 05f79d7bc617a76b45fd02701616c67f2115a75b..caea0237ea690525c85efae5f2acd95620dddbf1 100644 (file)
@@ -174,7 +174,7 @@ nir_live_ssa_defs_impl(nir_function_impl *impl)
     * can be compacted into a single bit.
     */
    state.num_ssa_defs = 1;
-   nir_foreach_block(impl, index_ssa_definitions_block, &state);
+   nir_foreach_block_call(impl, index_ssa_definitions_block, &state);
 
    nir_block_worklist_init(&state.worklist, impl->num_blocks, NULL);
 
@@ -183,7 +183,7 @@ nir_live_ssa_defs_impl(nir_function_impl *impl)
     * blocks to the worklist.
     */
    state.bitset_words = BITSET_WORDS(state.num_ssa_defs);
-   nir_foreach_block(impl, init_liveness_block, &state);
+   nir_foreach_block_call(impl, init_liveness_block, &state);
 
    /* We're now ready to work through the worklist and update the liveness
     * sets of each of the blocks.  By the time we get to this point, every
index 1548abbd558ae525e85254fcf4d1a5f085420650..589227631abf6c453a72af56af648593ab72033f 100644 (file)
@@ -257,7 +257,7 @@ nir_lower_alu_to_scalar_impl(nir_function_impl *impl)
    nir_builder builder;
    nir_builder_init(&builder, impl);
 
-   nir_foreach_block(impl, lower_alu_to_scalar_block, &builder);
+   nir_foreach_block_call(impl, lower_alu_to_scalar_block, &builder);
 }
 
 void
index b2ea31888f8fe43a6533e7936e1871477c1347e1..df34fdf7773e5e110a1075a2f92ea810446b46e7 100644 (file)
@@ -160,7 +160,7 @@ nir_lower_atomics(nir_shader *shader,
 
    nir_foreach_function(shader, function) {
       if (function->impl) {
-         nir_foreach_block(function->impl, lower_block, (void *) &state);
+         nir_foreach_block_call(function->impl, lower_block, (void *) &state);
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
       }
index c711230ad5baf57cefe381a7feb96e66bb1acb52..8437d2d775f48a6d63860d3429b967d351eb32fb 100644 (file)
@@ -146,7 +146,7 @@ find_output(nir_shader *shader, unsigned drvloc)
 
    nir_foreach_function(shader, function) {
       if (function->impl) {
-         nir_foreach_block_reverse(function->impl,
+         nir_foreach_block_reverse_call(function->impl,
                                    find_output_in_block, &state);
       }
    }
index d43683d2007be1f43cc8a75567f43f932e303787..4018d0bf216fa49c26f6d4de342a51abf003e34e 100644 (file)
@@ -81,7 +81,7 @@ lower_double_pack_impl(nir_function_impl *impl)
 {
    nir_builder b;
    nir_builder_init(&b, impl);
-   nir_foreach_block(impl, lower_double_pack_block, &b);
+   nir_foreach_block_call(impl, lower_double_pack_block, &b);
 }
 
 void
index 7b4cd4ee8dc8d77ea0fceeb4f57f5f3e5389fddb..fc9d304b85b2dfb552808849f56c789b63b1f90a 100644 (file)
@@ -85,7 +85,7 @@ nir_lower_global_vars_to_local(nir_shader *shader)
    nir_foreach_function(shader, function) {
       if (function->impl) {
          state.impl = function->impl;
-         nir_foreach_block(function->impl, mark_global_var_uses_block, &state);
+         nir_foreach_block_call(function->impl, mark_global_var_uses_block, &state);
       }
    }
 
index 14abfe3f50909516a70df43af85620d4f7c7ff4b..a868e105bc3b319cfe187cb162b0e9cf3e3d6fbb 100644 (file)
@@ -206,7 +206,7 @@ nir_lower_gs_intrinsics(nir_shader *shader)
          nir_builder_init(&b, function->impl);
          state.builder = &b;
 
-         nir_foreach_block(function->impl, rewrite_intrinsics, &state);
+         nir_foreach_block_call(function->impl, rewrite_intrinsics, &state);
 
          /* This only works because we have a single main() function. */
          append_set_vertex_count(function->impl->end_block, &state);
index a084ad9c0e5ea2f2ac7697b7182ca01b6027eba7..724c0c6eb3d25c614e052efcb3dbf3690d84834a 100644 (file)
@@ -136,7 +136,7 @@ convert_impl(nir_function_impl *impl)
    nir_builder b;
    nir_builder_init(&b, impl);
 
-   nir_foreach_block(impl, convert_block, &b);
+   nir_foreach_block_call(impl, convert_block, &b);
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
 }
index a69dd6125658cec6dddc0f59075e8a512f408dda..2484c49ec347cf821145ea5c7259832dce96a9cd 100644 (file)
@@ -214,7 +214,7 @@ lower_indirects_impl(nir_function_impl *impl, nir_variable_mode modes)
    state.modes = modes;
    nir_builder_init(&state.builder, impl);
 
-   nir_foreach_block(impl, lower_indirect_block, &state);
+   nir_foreach_block_call(impl, lower_indirect_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_none);
index df1f7a5d76535346d5ef2ff9655c4b7599ea5295..7679c02f6012ca66db4cbc85ce27b4c10548ea7d 100644 (file)
@@ -403,7 +403,7 @@ nir_lower_io_impl(nir_function_impl *impl,
    state.modes = modes;
    state.type_size = type_size;
 
-   nir_foreach_block(impl, nir_lower_io_block, &state);
+   nir_foreach_block_call(impl, nir_lower_io_block, &state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index db5865fb0c09c0aac6233a8a57b01268e186c75a..44242320b72e0a96f599949aed1e7898a09c88b9 100644 (file)
@@ -81,7 +81,7 @@ lower_load_const_to_scalar_block(nir_block *block, void *data)
 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_call(impl, lower_load_const_to_scalar_block, NULL);
 }
 
 void
index 111bfdd2e33f8a54cf6dedd84e2959595a747946..0a4d9befd730f36c71c051a32e0c72a1f30d6316 100644 (file)
@@ -358,7 +358,7 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
 
    nir_metadata_require(impl, nir_metadata_dominance);
 
-   nir_foreach_block(impl, lower_locals_to_regs_block, &state);
+   nir_foreach_block_call(impl, lower_locals_to_regs_block, &state);
 
    nir_array_foreach(&state.derefs_array, nir_deref_var *, deref_ptr) {
       nir_deref_var *deref = *deref_ptr;
index 00ac09114cf9cddd21766ce05532dc174e1b0815..c189947efae31eb07029a1be97cc1cca06532e74 100644 (file)
@@ -116,7 +116,7 @@ nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
          /* For geometry shaders, we have to emit the output copies right
           * before each EmitVertex call.
           */
-         nir_foreach_block(function->impl, emit_output_copies_block, &state);
+         nir_foreach_block_call(function->impl, emit_output_copies_block, &state);
       } else if (function == entrypoint) {
          /* For all other shader types, we need to do the copies right before
           * the jumps to the end block.
index 026c8665f91dcc856c03d34f202ace24605b07e9..78fbcad1de1916127366470e989637b50611cdd1 100644 (file)
@@ -272,7 +272,7 @@ lower_phis_to_scalar_impl(nir_function_impl *impl)
    state.phi_table = _mesa_hash_table_create(state.dead_ctx, _mesa_hash_pointer,
                                              _mesa_key_pointer_equal);
 
-   nir_foreach_block(impl, lower_phis_to_scalar_block, &state);
+   nir_foreach_block_call(impl, lower_phis_to_scalar_block, &state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index f5d3e596c20317475e83c9fd8210f36715db8e10..7dfa96cc98ac0c7c92c6db38d036550b4b80bf27 100644 (file)
@@ -184,7 +184,7 @@ lower_impl(nir_function_impl *impl, const struct gl_shader_program *shader_progr
    state.shader_program = shader_program;
    state.stage = stage;
 
-   nir_foreach_block(impl, lower_block_cb, &state);
+   nir_foreach_block_call(impl, lower_block_cb, &state);
 }
 
 void
index 2d3ccd7d0f98a040701ad0ad80f3c6f46c233903..ae613e20992497a0ba4e30cbfd46fda40fbe4cbb 100644 (file)
@@ -143,7 +143,7 @@ convert_impl(nir_function_impl *impl)
    state.progress = false;
    nir_builder_init(&state.builder, impl);
 
-   nir_foreach_block(impl, convert_block, &state);
+   nir_foreach_block_call(impl, convert_block, &state);
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
    return state.progress;
index 4cc18228d1d6cd691717c660d18347bb559356e3..16fee9a2ab10fe2c0ae495967330eca6fc0a9866 100644 (file)
@@ -379,7 +379,7 @@ nir_lower_tex_impl(nir_function_impl *impl, lower_tex_state *state)
 {
    nir_builder_init(&state->b, impl);
 
-   nir_foreach_block(impl, nir_lower_tex_block, state);
+   nir_foreach_block_call(impl, nir_lower_tex_block, state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index 1e8c3c2a13047eab0fb39dad92e0accd7d6280bf..369570ed684f9124f8a1112c7919ad70af250fea 100644 (file)
@@ -184,7 +184,7 @@ nir_lower_to_source_mods_block(nir_block *block, void *state)
 static void
 nir_lower_to_source_mods_impl(nir_function_impl *impl)
 {
-   nir_foreach_block(impl, nir_lower_to_source_mods_block, NULL);
+   nir_foreach_block_call(impl, nir_lower_to_source_mods_block, NULL);
 }
 
 void
index c7fb67e4f279dbe55a6cf523ef2191806905db47..04b058c15b7068b925df655a88494b108db9f49c 100644 (file)
@@ -185,7 +185,7 @@ nir_lower_two_sided_color_impl(nir_function_impl *impl,
 
    nir_builder_init(b, impl);
 
-   nir_foreach_block(impl, nir_lower_two_sided_color_block, state);
+   nir_foreach_block_call(impl, nir_lower_two_sided_color_block, state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index c994f0fe12c04d306ea40ee6e9332e4f7066f32c..a5e3805f1bebd3f05014047db37a77e9d36a46f1 100644 (file)
@@ -177,7 +177,7 @@ lower_var_copies_block(nir_block *block, void *mem_ctx)
 static void
 lower_var_copies_impl(nir_function_impl *impl)
 {
-   nir_foreach_block(impl, lower_var_copies_block, ralloc_parent(impl));
+   nir_foreach_block_call(impl, lower_var_copies_block, ralloc_parent(impl));
 }
 
 /* Lowers every copy_var instruction in the program to a sequence of
index 249c389233552ecc409966d71d23e0cedca91656..57d18401ca80e9994bc91568afae8af2394a5bb0 100644 (file)
@@ -653,7 +653,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
 
    /* Build the initial deref structures and direct_deref_nodes table */
    state.add_to_direct_deref_nodes = true;
-   nir_foreach_block(impl, register_variable_uses_block, &state);
+   nir_foreach_block_call(impl, register_variable_uses_block, &state);
 
    bool progress = false;
 
@@ -693,7 +693,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
     * added load/store instructions are registered.  We need this
     * information for phi node insertion below.
     */
-   nir_foreach_block(impl, register_variable_uses_block, &state);
+   nir_foreach_block_call(impl, register_variable_uses_block, &state);
 
    state.phi_builder = nir_phi_builder_create(state.impl);
 
index 9e40b84e6e39b55d21f205b227da363b1d711c40..ac8ff2ca58b4398e878f120d6a8e915c6bffa61a 100644 (file)
@@ -289,7 +289,7 @@ nir_lower_vec_to_movs_impl(nir_function_impl *impl)
 {
    struct vec_to_movs_state state = { impl, false };
 
-   nir_foreach_block(impl, lower_vec_to_movs_block, &state);
+   nir_foreach_block_call(impl, lower_vec_to_movs_block, &state);
 
    if (state.progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
index b5186e6e944d9924fe8826d49a6c785aa230246a..7ff4fe8c377cadd44afbacd8d0f4b423b2d9c17b 100644 (file)
@@ -181,7 +181,7 @@ nir_move_vec_src_uses_to_dest_impl(nir_shader *shader, nir_function_impl *impl)
    nir_metadata_require(impl, nir_metadata_dominance);
 
    nir_index_instrs(impl);
-   nir_foreach_block(impl, move_vec_src_uses_to_dest_block, shader);
+   nir_foreach_block_call(impl, move_vec_src_uses_to_dest_block, shader);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index 9c15eb8c15ccfe774834913dde952026f916ca5c..99eeacb1f5be6f3cef073aad15a8df936579a8a6 100644 (file)
@@ -98,7 +98,7 @@ normalize_cubemap_coords_impl(nir_function_impl *impl)
    nir_builder_init(&state.b, impl);
    state.progress = false;
 
-   nir_foreach_block(impl, normalize_cubemap_coords_block, &state);
+   nir_foreach_block_call(impl, normalize_cubemap_coords_block, &state);
 
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
index caa4231b1884d3728639c135e595897ec3f646e4..9232ec47b8ee33b96ed7a8cb96eab0c8c68e6224 100644 (file)
@@ -208,7 +208,7 @@ nir_opt_constant_folding_impl(nir_function_impl *impl)
    state.impl = impl;
    state.progress = false;
 
-   nir_foreach_block(impl, constant_fold_block, &state);
+   nir_foreach_block_call(impl, constant_fold_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_block_index |
index d99f78ddb36af3f1640fe41ad8b7a362a9567413..acae60e233fd317661b0bdcbc4abd23578ad38e4 100644 (file)
@@ -266,7 +266,7 @@ nir_copy_prop_impl(nir_function_impl *impl)
 {
    bool progress = false;
 
-   nir_foreach_block(impl, copy_prop_block, &progress);
+   nir_foreach_block_call(impl, copy_prop_block, &progress);
 
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
index cab09dfffc321c545cd66ca35dcaa34e47c2c56f..ee656ac2a67cd7c7dbcfdc9a7407b8582fed388d 100644 (file)
@@ -151,7 +151,7 @@ nir_opt_dce_impl(nir_function_impl *impl)
    struct exec_list *worklist = ralloc(NULL, struct exec_list);
    exec_list_make_empty(worklist);
 
-   nir_foreach_block(impl, init_block_cb, worklist);
+   nir_foreach_block_call(impl, init_block_cb, worklist);
 
    while (!exec_list_is_empty(worklist)) {
       nir_instr *instr = worklist_pop(worklist);
@@ -161,7 +161,7 @@ nir_opt_dce_impl(nir_function_impl *impl)
    ralloc_free(worklist);
 
    bool progress = false;
-   nir_foreach_block(impl, delete_block_cb, &progress);
+   nir_foreach_block_call(impl, delete_block_cb, &progress);
 
    if (progress)
       nir_metadata_preserve(impl, nir_metadata_block_index |
index 4658b23c57b9929ecde431b3ef517a8c406dcedd..d397695785f6cd77cf3681cd69a7436667145d1a 100644 (file)
@@ -199,7 +199,7 @@ loop_is_dead(nir_loop *loop)
        nir_block_first_instr(after)->type == nir_instr_type_phi)
       return false;
 
-   if (!nir_foreach_block_in_cf_node(&loop->cf_node, block_has_no_side_effects,
+   if (!nir_foreach_block_in_cf_node_call(&loop->cf_node, block_has_no_side_effects,
                                      NULL))
       return false;
 
index a8779ce5b84db5b48d9a364ad8130dd8dc45e5c2..25597ec5bbe2c05ac71f31dd3153c2bca5eab605 100644 (file)
@@ -467,7 +467,7 @@ opt_gcm_impl(nir_function_impl *impl)
                               nir_metadata_dominance);
 
    gcm_build_block_info(&impl->body, &state, 0);
-   nir_foreach_block(impl, gcm_pin_instructions_block, &state);
+   nir_foreach_block_call(impl, gcm_pin_instructions_block, &state);
 
    foreach_list_typed(nir_instr, instr, node, &state.instrs)
       gcm_schedule_early_instr(instr, &state);
index bad9dc457ad39f58c7e18fdb1740453ca20fd826..c1353b5bd91c04af801d0a90dffc5c7071bd6fab 100644 (file)
@@ -235,7 +235,7 @@ nir_opt_peephole_select_impl(nir_function_impl *impl)
    state.mem_ctx = ralloc_parent(impl);
    state.progress = false;
 
-   nir_foreach_block(impl, nir_opt_peephole_select_block, &state);
+   nir_foreach_block_call(impl, nir_opt_peephole_select_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_none);
index 646183707bd29a8f0b2390545c188373989d81fe..07c575660b49987c2c1a1a35249305df1e09ae71 100644 (file)
@@ -106,7 +106,7 @@ remove_phis_impl(nir_function_impl *impl)
 {
    bool progress = false;
 
-   nir_foreach_block(impl, remove_phis_block, &progress);
+   nir_foreach_block_call(impl, remove_phis_block, &progress);
 
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
index 374564d34c5898283a9f3e66387a6de3cb90a0e2..38208f8476f3cfa62e8db54930851abe48509634 100644 (file)
@@ -92,7 +92,7 @@ nir_opt_undef(nir_shader *shader)
 
    nir_foreach_function(shader, function) {
       if (function->impl) {
-         nir_foreach_block(function->impl, opt_undef_block, &progress);
+         nir_foreach_block_call(function->impl, opt_undef_block, &progress);
          if (progress)
             nir_metadata_preserve(function->impl,
                                   nir_metadata_block_index |
index 1f1388a73dd9f5f97de3a1c8d596ceee73dcd19a..1dd9c621cba4e0581b3703323ad5bf6980823a75 100644 (file)
@@ -99,7 +99,7 @@ nir_phi_builder_create(nir_function_impl *impl)
 
    pb->num_blocks = impl->num_blocks;
    pb->blocks = ralloc_array(pb, nir_block *, pb->num_blocks);
-   nir_foreach_block(impl, fill_block_array, pb->blocks);
+   nir_foreach_block_call(impl, fill_block_array, pb->blocks);
 
    exec_list_make_empty(&pb->values);
 
index 7395805d7a22eab42836f71367b641b392351523..22a286f041faab9a7cce844c7eaf8d4c857de52a 100644 (file)
@@ -97,7 +97,7 @@ add_var_use_shader(nir_shader *shader, struct set *live)
 {
    nir_foreach_function(shader, function) {
       if (function->impl) {
-         nir_foreach_block(function->impl, add_var_use_block, live);
+         nir_foreach_block_call(function->impl, add_var_use_block, live);
       }
    }
 }
index 96c791cbc6b60f28391da5fb093eaa130f3cc90d..336f7d59a4e6aedfe7275130af9ea3e9e416f85d 100644 (file)
@@ -123,7 +123,7 @@ nir_repair_ssa_impl(nir_function_impl *impl)
    nir_metadata_require(impl, nir_metadata_block_index |
                               nir_metadata_dominance);
 
-   nir_foreach_block(impl, repair_ssa_block, &state);
+   nir_foreach_block_call(impl, repair_ssa_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_block_index |
index 2b011077a7c1e38463ff8c9a97c7ea3a21617432..54024aae02c24a70c5ba344a40249542c551c280 100644 (file)
@@ -261,7 +261,7 @@ split_var_copies_impl(nir_function_impl *impl)
    state.dead_ctx = ralloc_context(NULL);
    state.progress = false;
 
-   nir_foreach_block(impl, split_var_copies_block, &state);
+   nir_foreach_block_call(impl, split_var_copies_block, &state);
 
    ralloc_free(state.dead_ctx);
 
index 3c3306c75fb924e1e3e67cd13b5515a4e9dcd26c..0555a0007cff98946d4d96ab96bb41d88640bac2 100644 (file)
@@ -1025,7 +1025,7 @@ validate_function_impl(nir_function_impl *impl, validate_state *state)
       postvalidate_reg_decl(reg, state);
    }
 
-   nir_foreach_block(impl, postvalidate_ssa_defs_block, state);
+   nir_foreach_block_call(impl, postvalidate_ssa_defs_block, state);
 }
 
 static void
index 3087a1d2354c6e83fd4927193ecca6be12f556be..d1ecdc4d6631976be3baebf1530662cec1c87ce4 100644 (file)
@@ -58,7 +58,7 @@ worklist_add_block(nir_block *block, void *w)
 void
 nir_block_worklist_add_all(nir_block_worklist *w, nir_function_impl *impl)
 {
-   nir_foreach_block(impl, worklist_add_block, w);
+   nir_foreach_block_call(impl, worklist_add_block, w);
 }
 
 void
index ec76b0bdc4d53b8bde779e5e60aa119d5153ee0e..8f7ea1c9083fd36910a8f736e31b8ad7f9366899 100644 (file)
@@ -315,7 +315,7 @@ lower_if_else_impl(nir_function_impl *impl)
        state.progress = false;
        nir_builder_init(&state.b, impl);
 
-       nir_foreach_block(impl, lower_if_else_block, &state);
+       nir_foreach_block_call(impl, lower_if_else_block, &state);
 
        if (state.progress)
                nir_metadata_preserve(impl, nir_metadata_none);
index cf6d2896f7dc052965cd525a7ddf8922992cd147..99cbf30863aa74bcc4ff7fc0e148e824db1f5e83 100644 (file)
@@ -714,7 +714,7 @@ vc4_nir_lower_blend(nir_shader *s, struct vc4_compile *c)
 {
         nir_foreach_function(s, function) {
                 if (function->impl) {
-                        nir_foreach_block(function->impl,
+                        nir_foreach_block_call(function->impl,
                                           vc4_nir_lower_blend_block, c);
 
                         nir_metadata_preserve(function->impl,
index 22c602adb54bbf681a20ae7e2e2db124f2542c8a..be89bfcc937e02e8ff1622c9efd163ea029d04f8 100644 (file)
@@ -446,7 +446,7 @@ vc4_nir_lower_io_block(nir_block *block, void *arg)
 static bool
 vc4_nir_lower_io_impl(struct vc4_compile *c, nir_function_impl *impl)
 {
-        nir_foreach_block(impl, vc4_nir_lower_io_block, c);
+        nir_foreach_block_call(impl, vc4_nir_lower_io_block, c);
 
         nir_metadata_preserve(impl, nir_metadata_block_index |
                               nir_metadata_dominance);
index 6b8830743eb69de196e457c41522aa152278f56f..0e7b2d5e25e270ce581e809d46746f1855a91832 100644 (file)
@@ -152,7 +152,7 @@ vc4_nir_lower_txf_ms_block(nir_block *block, void *arg)
 static bool
 vc4_nir_lower_txf_ms_impl(struct vc4_compile *c, nir_function_impl *impl)
 {
-        nir_foreach_block(impl, vc4_nir_lower_txf_ms_block, c);
+        nir_foreach_block_call(impl, vc4_nir_lower_txf_ms_block, c);
 
         nir_metadata_preserve(impl,
                               nir_metadata_block_index |
index eccc7ab413f919fe424572f4aae74f79471ceda9..8aba8badc4250faa330cf7ba77e9830d2693b8e6 100644 (file)
@@ -1794,7 +1794,7 @@ count_nir_instrs(nir_shader *nir)
         nir_foreach_function(nir, function) {
                 if (!function->impl)
                         continue;
-                nir_foreach_block(function->impl, count_nir_instrs_in_block, &count);
+                nir_foreach_block_call(function->impl, count_nir_instrs_in_block, &count);
         }
         return count;
 }
index 06fe8aafd301643433cb641b286a8eeb4944dee6..bbcbcc08f17e60382de644d14164128cfeb2cea5 100644 (file)
@@ -156,7 +156,8 @@ anv_nir_apply_dynamic_offsets(struct anv_pipeline *pipeline,
    nir_foreach_function(shader, function) {
       if (function->impl) {
          nir_builder_init(&state.builder, function->impl);
-         nir_foreach_block(function->impl, apply_dynamic_offsets_block, &state);
+         nir_foreach_block_call(function->impl, apply_dynamic_offsets_block,
+                                &state);
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
       }
index ef81afaf552e1ba28e3cef94221fc4cbf907f020..6b231fdaaefd39b66e6ec8c94a09a5b1e7612fe9 100644 (file)
@@ -275,7 +275,8 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
 
    nir_foreach_function(shader, function) {
       if (function->impl)
-         nir_foreach_block(function->impl, get_used_bindings_block, &state);
+         nir_foreach_block_call(function->impl, get_used_bindings_block,
+                                &state);
    }
 
    for (uint32_t set = 0; set < layout->num_sets; set++) {
@@ -333,7 +334,8 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
    nir_foreach_function(shader, function) {
       if (function->impl) {
          nir_builder_init(&state.builder, function->impl);
-         nir_foreach_block(function->impl, apply_pipeline_layout_block, &state);
+         nir_foreach_block_call(function->impl, apply_pipeline_layout_block,
+                                &state);
          nir_metadata_preserve(function->impl, nir_metadata_block_index |
                                                nir_metadata_dominance);
       }
index 44a1a3fde2775d2436f02496fc76275f4e9384db..7f875eba97c149fd127d3c6387952042a0b4c30e 100644 (file)
@@ -51,6 +51,6 @@ anv_nir_lower_push_constants(nir_shader *shader)
 {
    nir_foreach_function(shader, function) {
       if (function->impl)
-         nir_foreach_block(function->impl, lower_push_constants_block, NULL);
+         nir_foreach_block_call(function->impl, lower_push_constants_block, NULL);
    }
 }
index e7750494cf72220e26dc9fb5b33c2b99c207b992..d7eccd0df47e8237aa3dbc084c7eccaa993c8039 100644 (file)
@@ -350,7 +350,7 @@ fs_visitor::nir_emit_system_values()
    nir_foreach_function(nir, function) {
       assert(strcmp(function->name, "main") == 0);
       assert(function->impl);
-      nir_foreach_block(function->impl, emit_system_values_block, this);
+      nir_foreach_block_call(function->impl, emit_system_values_block, this);
    }
 }
 
index fb7fa23586101a77d07bd00240ecf9a01e642710..f9bcba292bd275010179092fb8e16a147f64817a 100644 (file)
@@ -95,7 +95,7 @@ add_const_offset_to_base(nir_shader *nir, nir_variable_mode mode)
    nir_foreach_function(nir, f) {
       if (f->impl) {
          nir_builder_init(&params.b, f->impl);
-         nir_foreach_block(f->impl, add_const_offset_to_base_block, &params);
+         nir_foreach_block_call(f->impl, add_const_offset_to_base_block, &params);
       }
    }
 }
@@ -239,7 +239,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir,
 
       nir_foreach_function(nir, function) {
          if (function->impl) {
-            nir_foreach_block(function->impl, remap_vs_attrs, &inputs_read);
+            nir_foreach_block_call(function->impl, remap_vs_attrs, &inputs_read);
          }
       }
    }
@@ -264,7 +264,7 @@ brw_nir_lower_vue_inputs(nir_shader *nir, bool is_scalar,
 
       nir_foreach_function(nir, function) {
          if (function->impl) {
-            nir_foreach_block(function->impl, remap_inputs_with_vue_map,
+            nir_foreach_block_call(function->impl, remap_inputs_with_vue_map,
                               (void *) vue_map);
          }
       }
@@ -291,7 +291,7 @@ brw_nir_lower_tes_inputs(nir_shader *nir, const struct brw_vue_map *vue_map)
    nir_foreach_function(nir, function) {
       if (function->impl) {
          nir_builder_init(&state.b, function->impl);
-         nir_foreach_block(function->impl, remap_patch_urb_offsets, &state);
+         nir_foreach_block_call(function->impl, remap_patch_urb_offsets, &state);
       }
    }
 }
@@ -338,7 +338,7 @@ brw_nir_lower_tcs_outputs(nir_shader *nir, const struct brw_vue_map *vue_map)
    nir_foreach_function(nir, function) {
       if (function->impl) {
          nir_builder_init(&state.b, function->impl);
-         nir_foreach_block(function->impl, remap_patch_urb_offsets, &state);
+         nir_foreach_block_call(function->impl, remap_patch_urb_offsets, &state);
       }
    }
 }
index 22eeb1a1296f175c3692a25f21fba7c4026becbf..69499f767540f9660cdb01054b57a732cf867e4f 100644 (file)
@@ -254,7 +254,7 @@ analyze_boolean_resolves_block(nir_block *block, void *void_state)
 static void
 analyze_boolean_resolves_impl(nir_function_impl *impl)
 {
-   nir_foreach_block(impl, analyze_boolean_resolves_block, NULL);
+   nir_foreach_block_call(impl, analyze_boolean_resolves_block, NULL);
 }
 
 void
index 9c65e540d7919058d6e06053381f6d1ad26e5454..57cc07da6e62b79f8ad39b3b754f4a75c78b4d96 100644 (file)
@@ -163,7 +163,7 @@ brw_nir_apply_attribute_workarounds(nir_shader *shader,
       nir_builder_init(&state.builder, func->impl);
       state.impl_progress = false;
 
-      nir_foreach_block(func->impl, apply_attr_wa_block, &state);
+      nir_foreach_block_call(func->impl, apply_attr_wa_block, &state);
 
       if (state.impl_progress) {
          nir_metadata_preserve(func->impl, nir_metadata_block_index |
index 22ff2e3c9f8073169de7e6db65d9e993edcca0ce..a38f721c45ed4165e660aed2b6b744f657334f6e 100644 (file)
@@ -292,7 +292,7 @@ brw_nir_opt_peephole_ffma_impl(nir_function_impl *impl)
    state.impl = impl;
    state.progress = false;
 
-   nir_foreach_block(impl, brw_nir_opt_peephole_ffma_block, &state);
+   nir_foreach_block_call(impl, brw_nir_opt_peephole_ffma_block, &state);
 
    if (state.progress)
       nir_metadata_preserve(impl, nir_metadata_block_index |
index aa3965a6c3a9ce3ebe970b70db0983c9d3a4460c..6bed6508d624216c8e060c1b413cb2f56a8e914b 100644 (file)
@@ -124,7 +124,7 @@ vec4_visitor::nir_setup_system_values()
    nir_foreach_function(nir, function) {
       assert(strcmp(function->name, "main") == 0);
       assert(function->impl);
-      nir_foreach_block(function->impl, setup_system_values_block, this);
+      nir_foreach_block_call(function->impl, setup_system_values_block, this);
    }
 }