summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir.c12
-rw-r--r--src/compiler/nir/nir.h6
-rw-r--r--src/compiler/nir/nir_algebraic.py2
-rw-r--r--src/compiler/nir/nir_dominance.c18
-rw-r--r--src/compiler/nir/nir_from_ssa.c12
-rw-r--r--src/compiler/nir/nir_gather_info.c2
-rw-r--r--src/compiler/nir/nir_inline_functions.c6
-rw-r--r--src/compiler/nir/nir_liveness.c4
-rw-r--r--src/compiler/nir/nir_lower_alu_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_atomics.c2
-rw-r--r--src/compiler/nir/nir_lower_clip.c2
-rw-r--r--src/compiler/nir/nir_lower_double_packing.c2
-rw-r--r--src/compiler/nir/nir_lower_global_vars_to_local.c2
-rw-r--r--src/compiler/nir/nir_lower_gs_intrinsics.c2
-rw-r--r--src/compiler/nir/nir_lower_idiv.c2
-rw-r--r--src/compiler/nir/nir_lower_indirect_derefs.c2
-rw-r--r--src/compiler/nir/nir_lower_io.c2
-rw-r--r--src/compiler/nir/nir_lower_load_const_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_locals_to_regs.c2
-rw-r--r--src/compiler/nir/nir_lower_outputs_to_temporaries.c2
-rw-r--r--src/compiler/nir/nir_lower_phis_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_samplers.c2
-rw-r--r--src/compiler/nir/nir_lower_system_values.c2
-rw-r--r--src/compiler/nir/nir_lower_tex.c2
-rw-r--r--src/compiler/nir/nir_lower_to_source_mods.c2
-rw-r--r--src/compiler/nir/nir_lower_two_sided_color.c2
-rw-r--r--src/compiler/nir/nir_lower_var_copies.c2
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c4
-rw-r--r--src/compiler/nir/nir_lower_vec_to_movs.c2
-rw-r--r--src/compiler/nir/nir_move_vec_src_uses_to_dest.c2
-rw-r--r--src/compiler/nir/nir_normalize_cubemap_coords.c2
-rw-r--r--src/compiler/nir/nir_opt_constant_folding.c2
-rw-r--r--src/compiler/nir/nir_opt_copy_propagate.c2
-rw-r--r--src/compiler/nir/nir_opt_dce.c4
-rw-r--r--src/compiler/nir/nir_opt_dead_cf.c2
-rw-r--r--src/compiler/nir/nir_opt_gcm.c2
-rw-r--r--src/compiler/nir/nir_opt_peephole_select.c2
-rw-r--r--src/compiler/nir/nir_opt_remove_phis.c2
-rw-r--r--src/compiler/nir/nir_opt_undef.c2
-rw-r--r--src/compiler/nir/nir_phi_builder.c2
-rw-r--r--src/compiler/nir/nir_remove_dead_variables.c2
-rw-r--r--src/compiler/nir/nir_repair_ssa.c2
-rw-r--r--src/compiler/nir/nir_split_var_copies.c2
-rw-r--r--src/compiler/nir/nir_validate.c2
-rw-r--r--src/compiler/nir/nir_worklist.c2
45 files changed, 70 insertions, 70 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 8d38d3384d8..5cafc41ec81 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -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;
}
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 3b82cfac1b5..4693ab58a59 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -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.
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
index 53a79073a44..76971714260 100644
--- a/src/compiler/nir/nir_algebraic.py
+++ b/src/compiler/nir/nir_algebraic.py
@@ -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 |
diff --git a/src/compiler/nir/nir_dominance.c b/src/compiler/nir/nir_dominance.c
index d95f3968074..0abfcd29609 100644
--- a/src/compiler/nir/nir_dominance.c
+++ b/src/compiler/nir/nir_dominance.c
@@ -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");
}
diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c
index 7bbc2c0f299..b24d60633a4 100644
--- a/src/compiler/nir/nir_from_ssa.c
+++ b/src/compiler/nir/nir_from_ssa.c
@@ -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);
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c
index bff235bb377..14da78d8cf7 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -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);
}
diff --git a/src/compiler/nir/nir_inline_functions.c b/src/compiler/nir/nir_inline_functions.c
index 4a08dcc96e0..30221326dfe 100644
--- a/src/compiler/nir/nir_inline_functions.c
+++ b/src/compiler/nir/nir_inline_functions.c
@@ -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 */
diff --git a/src/compiler/nir/nir_liveness.c b/src/compiler/nir/nir_liveness.c
index 05f79d7bc61..caea0237ea6 100644
--- a/src/compiler/nir/nir_liveness.c
+++ b/src/compiler/nir/nir_liveness.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_alu_to_scalar.c b/src/compiler/nir/nir_lower_alu_to_scalar.c
index 1548abbd558..589227631ab 100644
--- a/src/compiler/nir/nir_lower_alu_to_scalar.c
+++ b/src/compiler/nir/nir_lower_alu_to_scalar.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_atomics.c b/src/compiler/nir/nir_lower_atomics.c
index b2ea31888f8..df34fdf7773 100644
--- a/src/compiler/nir/nir_lower_atomics.c
+++ b/src/compiler/nir/nir_lower_atomics.c
@@ -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);
}
diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index c711230ad5b..8437d2d775f 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_lower_double_packing.c b/src/compiler/nir/nir_lower_double_packing.c
index d43683d2007..4018d0bf216 100644
--- a/src/compiler/nir/nir_lower_double_packing.c
+++ b/src/compiler/nir/nir_lower_double_packing.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_global_vars_to_local.c b/src/compiler/nir/nir_lower_global_vars_to_local.c
index 7b4cd4ee8dc..fc9d304b85b 100644
--- a/src/compiler/nir/nir_lower_global_vars_to_local.c
+++ b/src/compiler/nir/nir_lower_global_vars_to_local.c
@@ -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);
}
}
diff --git a/src/compiler/nir/nir_lower_gs_intrinsics.c b/src/compiler/nir/nir_lower_gs_intrinsics.c
index 14abfe3f509..a868e105bc3 100644
--- a/src/compiler/nir/nir_lower_gs_intrinsics.c
+++ b/src/compiler/nir/nir_lower_gs_intrinsics.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c
index a084ad9c0e5..724c0c6eb3d 100644
--- a/src/compiler/nir/nir_lower_idiv.c
+++ b/src/compiler/nir/nir_lower_idiv.c
@@ -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);
}
diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c
index a69dd612565..2484c49ec34 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index df1f7a5d765..7679c02f601 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -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);
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 db5865fb0c0..44242320b72 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c
index 111bfdd2e33..0a4d9befd73 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_outputs_to_temporaries.c b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
index 00ac09114cf..c189947efae 100644
--- a/src/compiler/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
@@ -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.
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
index 026c8665f91..78fbcad1de1 100644
--- a/src/compiler/nir/nir_lower_phis_to_scalar.c
+++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_samplers.c b/src/compiler/nir/nir_lower_samplers.c
index f5d3e596c20..7dfa96cc98a 100644
--- a/src/compiler/nir/nir_lower_samplers.c
+++ b/src/compiler/nir/nir_lower_samplers.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c
index 2d3ccd7d0f9..ae613e20992 100644
--- a/src/compiler/nir/nir_lower_system_values.c
+++ b/src/compiler/nir/nir_lower_system_values.c
@@ -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;
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 4cc18228d1d..16fee9a2ab1 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_to_source_mods.c b/src/compiler/nir/nir_lower_to_source_mods.c
index 1e8c3c2a130..369570ed684 100644
--- a/src/compiler/nir/nir_lower_to_source_mods.c
+++ b/src/compiler/nir/nir_lower_to_source_mods.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_two_sided_color.c b/src/compiler/nir/nir_lower_two_sided_color.c
index c7fb67e4f27..04b058c15b7 100644
--- a/src/compiler/nir/nir_lower_two_sided_color.c
+++ b/src/compiler/nir/nir_lower_two_sided_color.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c
index c994f0fe12c..a5e3805f1be 100644
--- a/src/compiler/nir/nir_lower_var_copies.c
+++ b/src/compiler/nir/nir_lower_var_copies.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index 249c3892335..57d18401ca8 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -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);
diff --git a/src/compiler/nir/nir_lower_vec_to_movs.c b/src/compiler/nir/nir_lower_vec_to_movs.c
index 9e40b84e6e3..ac8ff2ca58b 100644
--- a/src/compiler/nir/nir_lower_vec_to_movs.c
+++ b/src/compiler/nir/nir_lower_vec_to_movs.c
@@ -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 |
diff --git a/src/compiler/nir/nir_move_vec_src_uses_to_dest.c b/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
index b5186e6e944..7ff4fe8c377 100644
--- a/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
+++ b/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
@@ -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);
diff --git a/src/compiler/nir/nir_normalize_cubemap_coords.c b/src/compiler/nir/nir_normalize_cubemap_coords.c
index 9c15eb8c15c..99eeacb1f5b 100644
--- a/src/compiler/nir/nir_normalize_cubemap_coords.c
+++ b/src/compiler/nir/nir_normalize_cubemap_coords.c
@@ -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);
diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index caa4231b188..9232ec47b8e 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -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 |
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index d99f78ddb36..acae60e233f 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -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 |
diff --git a/src/compiler/nir/nir_opt_dce.c b/src/compiler/nir/nir_opt_dce.c
index cab09dfffc3..ee656ac2a67 100644
--- a/src/compiler/nir/nir_opt_dce.c
+++ b/src/compiler/nir/nir_opt_dce.c
@@ -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 |
diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c
index 4658b23c57b..d397695785f 100644
--- a/src/compiler/nir/nir_opt_dead_cf.c
+++ b/src/compiler/nir/nir_opt_dead_cf.c
@@ -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;
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index a8779ce5b84..25597ec5bbe 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -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);
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c
index bad9dc457ad..c1353b5bd91 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -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);
diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c
index 646183707bd..07c575660b4 100644
--- a/src/compiler/nir/nir_opt_remove_phis.c
+++ b/src/compiler/nir/nir_opt_remove_phis.c
@@ -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 |
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
index 374564d34c5..38208f8476f 100644
--- a/src/compiler/nir/nir_opt_undef.c
+++ b/src/compiler/nir/nir_opt_undef.c
@@ -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 |
diff --git a/src/compiler/nir/nir_phi_builder.c b/src/compiler/nir/nir_phi_builder.c
index 1f1388a73dd..1dd9c621cba 100644
--- a/src/compiler/nir/nir_phi_builder.c
+++ b/src/compiler/nir/nir_phi_builder.c
@@ -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);
diff --git a/src/compiler/nir/nir_remove_dead_variables.c b/src/compiler/nir/nir_remove_dead_variables.c
index 7395805d7a2..22a286f041f 100644
--- a/src/compiler/nir/nir_remove_dead_variables.c
+++ b/src/compiler/nir/nir_remove_dead_variables.c
@@ -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);
}
}
}
diff --git a/src/compiler/nir/nir_repair_ssa.c b/src/compiler/nir/nir_repair_ssa.c
index 96c791cbc6b..336f7d59a4e 100644
--- a/src/compiler/nir/nir_repair_ssa.c
+++ b/src/compiler/nir/nir_repair_ssa.c
@@ -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 |
diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c
index 2b011077a7c..54024aae02c 100644
--- a/src/compiler/nir/nir_split_var_copies.c
+++ b/src/compiler/nir/nir_split_var_copies.c
@@ -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);
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 3c3306c75fb..0555a0007cf 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -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
diff --git a/src/compiler/nir/nir_worklist.c b/src/compiler/nir/nir_worklist.c
index 3087a1d2354..d1ecdc4d663 100644
--- a/src/compiler/nir/nir_worklist.c
+++ b/src/compiler/nir/nir_worklist.c
@@ -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