diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index dcdf33cf6b1..b86bc27b160 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -468,9 +468,8 @@ iris_setup_uniforms(ASSERTED const struct intel_device_info *devinfo, nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_builder b = nir_builder_create(impl); + nir_builder b = nir_builder_at(nir_before_block(nir_start_block(impl))); - b.cursor = nir_before_block(nir_start_block(impl)); nir_ssa_def *temp_ubo_name = nir_ssa_undef(&b, 1, 32); /* Turn system value intrinsics into uniforms */ diff --git a/src/intel/compiler/brw_mesh.cpp b/src/intel/compiler/brw_mesh.cpp index 04475791aba..5faa75ba1fa 100644 --- a/src/intel/compiler/brw_mesh.cpp +++ b/src/intel/compiler/brw_mesh.cpp @@ -639,8 +639,7 @@ brw_nir_initialize_mue(nir_shader *nir, nir_builder b; nir_function_impl *entrypoint = nir_shader_get_entrypoint(nir); - b = nir_builder_create(entrypoint); - b.cursor = nir_before_block(nir_start_block(entrypoint)); + b = nir_builder_at(nir_before_block(nir_start_block(entrypoint))); nir_ssa_def *dw_off = nir_imm_int(&b, 0); nir_ssa_def *zerovec = nir_imm_vec4(&b, 0, 0, 0, 0); diff --git a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c index 62256299cb3..8618270e9f0 100644 --- a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c +++ b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c @@ -167,11 +167,9 @@ brw_nir_lower_alpha_to_coverage(nir_shader *shader, &sample_mask_write->instr); } - nir_builder b = nir_builder_create(impl); + nir_builder b = nir_builder_at(nir_before_instr(&sample_mask_write->instr)); /* Combine dither_mask and the gl_SampleMask value */ - b.cursor = nir_before_instr(&sample_mask_write->instr); - nir_ssa_def *dither_mask = build_dither_mask(&b, color0); dither_mask = nir_iand(&b, sample_mask, dither_mask); diff --git a/src/intel/compiler/brw_nir_lower_intersection_shader.c b/src/intel/compiler/brw_nir_lower_intersection_shader.c index af6b011bf7d..f636cfe7f18 100644 --- a/src/intel/compiler/brw_nir_lower_intersection_shader.c +++ b/src/intel/compiler/brw_nir_lower_intersection_shader.c @@ -55,11 +55,9 @@ lower_any_hit_for_intersection(nir_shader *any_hit) ralloc_array(any_hit, nir_parameter, ARRAY_SIZE(params)); memcpy(impl->function->params, params, sizeof(params)); - nir_builder build = nir_builder_create(impl); + nir_builder build = nir_builder_at(nir_before_cf_list(&impl->body)); nir_builder *b = &build; - b->cursor = nir_before_cf_list(&impl->body); - nir_ssa_def *commit_ptr = nir_load_param(b, 0); nir_ssa_def *hit_t = nir_load_param(b, 1); nir_ssa_def *hit_kind = nir_load_param(b, 2); @@ -156,11 +154,9 @@ brw_nir_lower_intersection_shader(nir_shader *intersection, nir_function_impl *impl = nir_shader_get_entrypoint(intersection); - nir_builder build = nir_builder_create(impl); + nir_builder build = nir_builder_at(nir_before_cf_list(&impl->body)); nir_builder *b = &build; - b->cursor = nir_before_cf_list(&impl->body); - nir_ssa_def *t_addr = brw_nir_rt_mem_hit_addr(b, false /* committed */); nir_variable *commit = nir_local_variable_create(impl, glsl_bool_type(), "ray_commit"); diff --git a/src/intel/compiler/brw_nir_lower_ray_queries.c b/src/intel/compiler/brw_nir_lower_ray_queries.c index c1a9217f620..63f099062b3 100644 --- a/src/intel/compiler/brw_nir_lower_ray_queries.c +++ b/src/intel/compiler/brw_nir_lower_ray_queries.c @@ -503,9 +503,7 @@ static void lower_ray_query_impl(nir_function_impl *impl, struct lowering_state *state) { nir_builder _b, *b = &_b; - _b = nir_builder_create(impl); - - b->cursor = nir_before_block(nir_start_block(b->impl)); + _b = nir_builder_at(nir_before_block(nir_start_block(impl))); state->rq_globals = nir_load_ray_query_global_intel(b); diff --git a/src/intel/compiler/brw_nir_lower_rt_intrinsics.c b/src/intel/compiler/brw_nir_lower_rt_intrinsics.c index db3f0cda608..e89bcdefccf 100644 --- a/src/intel/compiler/brw_nir_lower_rt_intrinsics.c +++ b/src/intel/compiler/brw_nir_lower_rt_intrinsics.c @@ -50,11 +50,9 @@ lower_rt_intrinsics_impl(nir_function_impl *impl, { bool progress = false; - nir_builder build = nir_builder_create(impl); + nir_builder build = nir_builder_at(nir_before_block(nir_start_block(impl))); nir_builder *b = &build; - b->cursor = nir_before_block(nir_start_block(b->impl)); - struct brw_nir_rt_globals_defs globals; brw_nir_rt_load_globals(b, &globals); diff --git a/src/intel/compiler/brw_nir_rt.c b/src/intel/compiler/brw_nir_rt.c index 97402bd591d..eb821cfc5c0 100644 --- a/src/intel/compiler/brw_nir_rt.c +++ b/src/intel/compiler/brw_nir_rt.c @@ -78,9 +78,8 @@ lower_rt_io_derefs(nir_shader *shader) */ assert(num_shader_call_vars <= 1); - nir_builder b = nir_builder_create(impl); + nir_builder b = nir_builder_at(nir_before_cf_list(&impl->body)); - b.cursor = nir_before_cf_list(&impl->body); nir_ssa_def *call_data_addr = NULL; if (num_shader_call_vars > 0) { assert(shader->scratch_size >= BRW_BTD_STACK_CALLEE_DATA_SIZE); diff --git a/src/intel/vulkan/anv_mesh_perprim_wa.c b/src/intel/vulkan/anv_mesh_perprim_wa.c index 057ed91fdd9..00fd2338cad 100644 --- a/src/intel/vulkan/anv_mesh_perprim_wa.c +++ b/src/intel/vulkan/anv_mesh_perprim_wa.c @@ -153,8 +153,7 @@ anv_mesh_convert_attrs_prim_to_vert(struct nir_shader *nir, num_mesh_vertices_per_primitive(nir->info.mesh.primitive_type); nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_builder b = nir_builder_create(impl); - b.cursor = nir_after_cf_list(&impl->body); + nir_builder b = nir_builder_at(nir_after_cf_list(&impl->body)); /* wait for all subgroups to finish */ nir_scoped_barrier(&b, SCOPE_WORKGROUP); @@ -494,8 +493,7 @@ anv_frag_convert_attrs_prim_to_vert(struct nir_shader *nir, nir_deref_instr *new_derefs[VARYING_SLOT_MAX] = {NULL, }; nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_builder b = nir_builder_create(impl); - b.cursor = nir_before_cf_list(&impl->body); + nir_builder b = nir_builder_at(nir_before_cf_list(&impl->body)); nir_foreach_shader_in_variable_safe(var, nir) { gl_varying_slot location = var->data.location; diff --git a/src/intel/vulkan/anv_nir_lower_multiview.c b/src/intel/vulkan/anv_nir_lower_multiview.c index b5459229b81..3ea2def2948 100644 --- a/src/intel/vulkan/anv_nir_lower_multiview.c +++ b/src/intel/vulkan/anv_nir_lower_multiview.c @@ -204,8 +204,7 @@ anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask, bool progress = nir_lower_multiview(shader, view_mask); if (progress) { - nir_builder b = nir_builder_create(entrypoint); - b.cursor = nir_before_cf_list(&entrypoint->body); + nir_builder b = nir_builder_at(nir_before_cf_list(&entrypoint->body)); /* Fill Layer ID with zero. Replication will use that as base to * apply the RTAI offsets. diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 786e056eb30..1628154b0f7 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -122,8 +122,7 @@ anv_nir_lower_set_vtx_and_prim_count(nir_shader *nir) if (state.primitive_count == NULL) { nir_builder b; nir_function_impl *entrypoint = nir_shader_get_entrypoint(nir); - b = nir_builder_create(entrypoint); - b.cursor = nir_before_block(nir_start_block(entrypoint)); + b = nir_builder_at(nir_before_block(nir_start_block(entrypoint))); nir_ssa_def *zero = nir_imm_int(&b, 0); state.primitive_count = anv_nir_prim_count_store(&b, zero); }