nir: Switch the arguments to nir_foreach_function

This matches the "foreach x in container" pattern found in many other
programming languages.  Generated by the following regular expression:

s/nir_foreach_function(\([^,]*\),\s*\([^,]*\))/nir_foreach_function(\2, \1)/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Jason Ekstrand 2016-04-26 20:26:42 -07:00
parent e63766fb4b
commit 9464d8c498
61 changed files with 77 additions and 77 deletions

View File

@ -1820,7 +1820,7 @@ nir_shader_get_entrypoint(nir_shader *shader)
return func;
}
#define nir_foreach_function(shader, func) \
#define nir_foreach_function(func, shader) \
foreach_list_typed(nir_function, func, node, &(shader)->functions)
nir_shader *nir_shader_create(void *mem_ctx,

View File

@ -584,7 +584,7 @@ ${pass_name}(nir_shader *shader)
condition_flags[${index}] = ${condition};
% endfor
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= ${pass_name}_impl(function->impl, condition_flags);
}

View File

@ -701,7 +701,7 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s)
* functions of other functions and we don't know what order the functions
* will have in the list.
*/
nir_foreach_function(s, fxn) {
nir_foreach_function(fxn, s) {
nir_function *nfxn = remap_global(&state, fxn);
nfxn->impl = clone_function_impl(&state, fxn->impl);
nfxn->impl->function = nfxn;

View File

@ -198,7 +198,7 @@ nir_calc_dominance_impl(nir_function_impl *impl)
void
nir_calc_dominance(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_calc_dominance_impl(function->impl);
}
@ -258,7 +258,7 @@ nir_dump_dom_tree_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_dom_tree(nir_shader *shader, FILE *fp)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_dom_tree_impl(function->impl, fp);
}
@ -281,7 +281,7 @@ nir_dump_dom_frontier_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_dom_frontier(nir_shader *shader, FILE *fp)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_dom_frontier_impl(function->impl, fp);
}
@ -305,7 +305,7 @@ nir_dump_cfg_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_cfg(nir_shader *shader, FILE *fp)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_cfg_impl(function->impl, fp);
}

View File

@ -805,7 +805,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only)
void
nir_convert_from_ssa(nir_shader *shader, bool phi_webs_only)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_convert_from_ssa_impl(function->impl, phi_webs_only);
}

View File

@ -55,7 +55,7 @@ nir_gs_count_vertices(const nir_shader *shader)
{
int count = -1;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;

View File

@ -252,7 +252,7 @@ nir_inline_functions(nir_shader *shader)
_mesa_key_pointer_equal);
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = inline_function_impl(function->impl, inlined) || progress;
}

View File

@ -257,7 +257,7 @@ nir_lower_alu_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_alu_to_scalar(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_alu_to_scalar_impl(function->impl);
}

View File

@ -137,7 +137,7 @@ void
nir_lower_atomics(nir_shader *shader,
const struct gl_shader_program *shader_program)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr_safe(instr, block) {

View File

@ -124,7 +124,7 @@ static nir_ssa_def *
find_output(nir_shader *shader, unsigned drvloc)
{
nir_ssa_def *def = NULL;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block_reverse(block, function->impl) {
nir_ssa_def *new_def = find_output_in_block(block, drvloc);
@ -250,7 +250,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables)
out[1] =
create_clipdist_var(shader, ++maxloc, true, VARYING_SLOT_CLIP_DIST1);
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!strcmp(function->name, "main"))
lower_clip_vs(function->impl, ucp_enables, cv, out);
}
@ -324,7 +324,7 @@ nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables)
create_clipdist_var(shader, ++maxloc, false,
VARYING_SLOT_CLIP_DIST1);
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!strcmp(function->name, "main"))
lower_clip_fs(function->impl, ucp_enables, in);
}

View File

@ -557,7 +557,7 @@ lower_doubles_impl(nir_function_impl *impl, nir_lower_doubles_options options)
void
nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
lower_doubles_impl(function->impl, options);
}

View File

@ -87,7 +87,7 @@ lower_double_pack_impl(nir_function_impl *impl)
void
nir_lower_double_pack(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
lower_double_pack_impl(function->impl);
}

View File

@ -76,7 +76,7 @@ nir_lower_global_vars_to_local(nir_shader *shader)
_mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl)
mark_global_var_uses_block(block, function->impl, var_func_table);

View File

@ -198,7 +198,7 @@ nir_lower_gs_intrinsics(nir_shader *shader)
exec_list_push_tail(&shader->globals, &var->node);
state.vertex_count_var = var;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);

View File

@ -137,7 +137,7 @@ convert_impl(nir_function_impl *impl)
void
nir_lower_idiv(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
convert_impl(function->impl);
}

View File

@ -227,7 +227,7 @@ nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = lower_indirects_impl(function->impl, modes) || progress;
}

View File

@ -414,7 +414,7 @@ void
nir_lower_io(nir_shader *shader, nir_variable_mode modes,
int (*type_size)(const struct glsl_type *))
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_io_impl(function->impl, modes, type_size);
}

View File

@ -81,7 +81,7 @@ nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_load_const_to_scalar(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_load_const_to_scalar_impl(function->impl);
}

View File

@ -390,7 +390,7 @@ nir_lower_locals_to_regs(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_locals_to_regs_impl(function->impl) || progress;
}

View File

@ -108,7 +108,7 @@ nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
exec_list_push_tail(&shader->outputs, &output->node);
}
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl == NULL)
continue;

View File

@ -291,7 +291,7 @@ lower_phis_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_phis_to_scalar(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
lower_phis_to_scalar_impl(function->impl);
}

View File

@ -237,7 +237,7 @@ nir_lower_returns(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_returns_impl(function->impl) || progress;
}

View File

@ -171,7 +171,7 @@ void
nir_lower_samplers(nir_shader *shader,
const struct gl_shader_program *shader_program)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
lower_impl(function->impl, shader_program, shader->stage);
}

View File

@ -149,7 +149,7 @@ nir_lower_system_values(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = convert_impl(function->impl) || progress;
}

View File

@ -392,7 +392,7 @@ nir_lower_tex(nir_shader *shader, const nir_lower_tex_options *options)
state.options = options;
state.progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_tex_impl(function->impl, &state);
}

View File

@ -184,7 +184,7 @@ nir_lower_to_source_mods_block(nir_block *block)
void
nir_lower_to_source_mods(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_lower_to_source_mods_block(block);

View File

@ -204,7 +204,7 @@ nir_lower_two_sided_color(nir_shader *shader)
if (setup_inputs(&state) != 0)
return;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_two_sided_color_impl(function->impl, &state);
}

View File

@ -182,7 +182,7 @@ lower_var_copies_impl(nir_function_impl *impl)
void
nir_lower_var_copies(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
lower_var_copies_impl(function->impl);
}

View File

@ -752,7 +752,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
void
nir_lower_vars_to_ssa(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_vars_to_ssa_impl(function->impl);
}

View File

@ -300,7 +300,7 @@ nir_lower_vec_to_movs(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_vec_to_movs_impl(function->impl) || progress;
}

View File

@ -63,7 +63,7 @@ nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved)
void
nir_metadata_set_validation_flag(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
function->impl->valid_metadata |= nir_metadata_not_properly_reset;
}
@ -80,7 +80,7 @@ nir_metadata_set_validation_flag(nir_shader *shader)
void
nir_metadata_check_validation_flag(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
assert(!(function->impl->valid_metadata &
nir_metadata_not_properly_reset));

View File

@ -193,7 +193,7 @@ nir_move_vec_src_uses_to_dest_impl(nir_shader *shader, nir_function_impl *impl)
void
nir_move_vec_src_uses_to_dest(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_move_vec_src_uses_to_dest_impl(shader, function->impl);
}

View File

@ -107,7 +107,7 @@ nir_normalize_cubemap_coords(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = normalize_cubemap_coords_impl(function->impl) || progress;
}

View File

@ -220,7 +220,7 @@ nir_opt_constant_folding(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_constant_folding_impl(function->impl);
}

View File

@ -269,7 +269,7 @@ nir_copy_prop(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl && nir_copy_prop_impl(function->impl))
progress = true;
}

View File

@ -83,7 +83,7 @@ nir_opt_cse(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_cse_impl(function->impl);
}

View File

@ -167,7 +167,7 @@ bool
nir_opt_dce(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl && nir_opt_dce_impl(function->impl))
progress = true;
}

View File

@ -349,7 +349,7 @@ nir_opt_dead_cf(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function)
nir_foreach_function(function, shader)
if (function->impl)
progress |= opt_dead_cf_impl(function->impl);

View File

@ -488,7 +488,7 @@ opt_gcm_impl(nir_function_impl *impl)
void
nir_opt_gcm(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
opt_gcm_impl(function->impl);
}

View File

@ -239,7 +239,7 @@ nir_opt_peephole_select(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_peephole_select_impl(function->impl);
}

View File

@ -123,7 +123,7 @@ nir_opt_remove_phis(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function)
nir_foreach_function(function, shader)
if (function->impl)
progress = remove_phis_impl(function->impl) || progress;

View File

@ -76,7 +76,7 @@ nir_opt_undef(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr_safe(instr, block) {

View File

@ -68,7 +68,7 @@ add_var_use_tex(nir_tex_instr *instr, struct set *live)
static void
add_var_use_shader(nir_shader *shader, struct set *live)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr(instr, block) {
@ -136,7 +136,7 @@ nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes)
progress = remove_dead_vars(&shader->system_values, live) || progress;
if (modes & nir_var_local) {
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl) {
if (remove_dead_vars(&function->impl->locals, live)) {
nir_metadata_preserve(function->impl, nir_metadata_block_index |

View File

@ -143,7 +143,7 @@ nir_repair_ssa(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_repair_ssa_impl(function->impl) || progress;
}

View File

@ -278,7 +278,7 @@ nir_split_var_copies(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress = split_var_copies_impl(function->impl) || progress;
}

View File

@ -533,7 +533,7 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
void
nir_convert_to_ssa(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
nir_convert_to_ssa_impl(function->impl);
}

View File

@ -2157,7 +2157,7 @@ emit_instructions(struct ir3_compile *ctx)
nir_function_impl *fxn = NULL;
/* Find the main function: */
nir_foreach_function(ctx->s, function) {
nir_foreach_function(function, ctx->s) {
compile_assert(ctx, strcmp(function->name, "main") == 0);
compile_assert(ctx, function->impl);
fxn = function->impl;

View File

@ -328,7 +328,7 @@ ir3_nir_lower_if_else(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= lower_if_else_impl(function->impl);
}

View File

@ -712,7 +712,7 @@ vc4_nir_lower_blend_block(nir_block *block, void *state)
void
vc4_nir_lower_blend(nir_shader *s, struct vc4_compile *c)
{
nir_foreach_function(s, function) {
nir_foreach_function(function, s) {
if (function->impl) {
nir_foreach_block_call(function->impl,
vc4_nir_lower_blend_block, c);

View File

@ -457,7 +457,7 @@ vc4_nir_lower_io_impl(struct vc4_compile *c, nir_function_impl *impl)
void
vc4_nir_lower_io(nir_shader *s, struct vc4_compile *c)
{
nir_foreach_function(s, function) {
nir_foreach_function(function, s) {
if (function->impl)
vc4_nir_lower_io_impl(c, function->impl);
}

View File

@ -164,7 +164,7 @@ vc4_nir_lower_txf_ms_impl(struct vc4_compile *c, nir_function_impl *impl)
void
vc4_nir_lower_txf_ms(nir_shader *s, struct vc4_compile *c)
{
nir_foreach_function(s, function) {
nir_foreach_function(function, s) {
if (function->impl)
vc4_nir_lower_txf_ms_impl(c, function->impl);
}

View File

@ -1759,7 +1759,7 @@ nir_to_qir(struct vc4_compile *c)
ntq_setup_registers(c, &c->s->registers);
/* Find the main function and emit the body. */
nir_foreach_function(c->s, function) {
nir_foreach_function(function, c->s) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
ntq_emit_impl(c, function->impl);
@ -1791,7 +1791,7 @@ static int
count_nir_instrs(nir_shader *nir)
{
int count = 0;
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (!function->impl)
continue;
nir_foreach_block_call(function->impl, count_nir_instrs_in_block, &count);

View File

@ -137,7 +137,7 @@ anv_nir_apply_dynamic_offsets(struct anv_pipeline *pipeline,
if (!layout || !layout->stage[shader->stage].has_dynamic_offsets)
return;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;

View File

@ -267,7 +267,7 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
state.set[s].image_offsets = rzalloc_array(mem_ctx, uint8_t, count);
}
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;
@ -327,7 +327,7 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
}
}
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;

View File

@ -26,7 +26,7 @@
void
anv_nir_lower_push_constants(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;

View File

@ -42,7 +42,7 @@ fs_visitor::emit_nir_code()
nir_emit_system_values();
/* get the main function and emit it */
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
nir_emit_impl(function->impl);
@ -344,7 +344,7 @@ fs_visitor::nir_emit_system_values()
nir_system_values[i] = fs_reg();
}
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
nir_foreach_block(block, function->impl) {

View File

@ -84,7 +84,7 @@ add_const_offset_to_base_block(nir_block *block, nir_builder *b,
static void
add_const_offset_to_base(nir_shader *nir, nir_variable_mode mode)
{
nir_foreach_function(nir, f) {
nir_foreach_function(f, nir) {
if (f->impl) {
nir_builder b;
nir_builder_init(&b, f->impl);
@ -222,7 +222,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir,
*/
GLbitfield64 inputs_read = nir->info.inputs_read;
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
remap_vs_attrs(block, inputs_read);
@ -249,7 +249,7 @@ brw_nir_lower_vue_inputs(nir_shader *nir, bool is_scalar,
add_const_offset_to_base(nir, nir_var_shader_in);
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
remap_inputs_with_vue_map(block, vue_map);
@ -273,7 +273,7 @@ brw_nir_lower_tes_inputs(nir_shader *nir, const struct brw_vue_map *vue_map)
add_const_offset_to_base(nir, nir_var_shader_in);
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);
@ -320,7 +320,7 @@ brw_nir_lower_tcs_outputs(nir_shader *nir, const struct brw_vue_map *vue_map)
add_const_offset_to_base(nir, nir_var_shader_out);
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);
@ -501,7 +501,7 @@ brw_postprocess_nir(nir_shader *nir,
if (unlikely(debug_enabled)) {
/* Re-index SSA defs so we print more sensible numbers. */
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
if (function->impl)
nir_index_ssa_defs(function->impl);
}

View File

@ -262,7 +262,7 @@ analyze_boolean_resolves_impl(nir_function_impl *impl)
void
brw_nir_analyze_boolean_resolves(nir_shader *shader)
{
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
analyze_boolean_resolves_impl(function->impl);
}

View File

@ -155,7 +155,7 @@ brw_nir_apply_attribute_workarounds(nir_shader *shader,
.wa_flags = attrib_wa_flags,
};
nir_foreach_function(shader, func) {
nir_foreach_function(func, shader) {
if (!func->impl)
continue;

View File

@ -303,7 +303,7 @@ brw_nir_opt_peephole_ffma(nir_shader *shader)
{
bool progress = false;
nir_foreach_function(shader, function) {
nir_foreach_function(function, shader) {
if (function->impl)
progress |= brw_nir_opt_peephole_ffma_impl(function->impl);
}

View File

@ -41,7 +41,7 @@ vec4_visitor::emit_nir_code()
nir_setup_system_values();
/* get the main function and emit it */
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
nir_emit_impl(function->impl);
@ -119,7 +119,7 @@ vec4_visitor::nir_setup_system_values()
nir_system_values[i] = dst_reg();
}
nir_foreach_function(nir, function) {
nir_foreach_function(function, nir) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
nir_foreach_block(block, function->impl) {