diff --git a/src/amd/common/nir/ac_nir.c b/src/amd/common/nir/ac_nir.c index ca3aa270947..87ee4391e45 100644 --- a/src/amd/common/nir/ac_nir.c +++ b/src/amd/common/nir/ac_nir.c @@ -228,7 +228,8 @@ ac_nir_lower_indirect_derefs(nir_shader *shader, glsl_get_natural_size_align_bytes, glsl_get_natural_size_align_bytes); /* This lowers indirect indexing to if-else ladders. */ - NIR_PASS(progress, shader, nir_lower_indirect_derefs, nir_var_function_temp, UINT32_MAX); + NIR_PASS(progress, shader, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, UINT32_MAX); return progress; } diff --git a/src/amd/vulkan/nir/radv_nir_lower_hit_attrib_derefs.c b/src/amd/vulkan/nir/radv_nir_lower_hit_attrib_derefs.c index 38e14dd4015..bb3d9e3dec4 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_hit_attrib_derefs.c +++ b/src/amd/vulkan/nir/radv_nir_lower_hit_attrib_derefs.c @@ -127,7 +127,7 @@ radv_nir_lower_rt_vars(nir_shader *shader, nir_variable_mode mode, uint32_t base { bool progress = false; - progress |= nir_lower_indirect_derefs(shader, mode, UINT32_MAX); + progress |= nir_lower_indirect_derefs_to_if_else_trees(shader, mode, UINT32_MAX); progress |= nir_lower_vars_to_explicit_types(shader, mode, glsl_get_natural_size_align_bytes); diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 5052393c52b..4aaf71ba883 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -3689,7 +3689,8 @@ agx_preprocess_nir(nir_shader *nir) /* Lower large arrays to scratch and small arrays to csel */ NIR_PASS(_, nir, nir_lower_vars_to_scratch, nir_var_function_temp, 256, glsl_get_natural_size_align_bytes, glsl_get_word_size_align_bytes); - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, ~0); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, ~0); NIR_PASS(_, nir, nir_split_var_copies); NIR_PASS(_, nir, nir_lower_global_vars_to_local); NIR_PASS(_, nir, nir_lower_var_copies); @@ -3805,7 +3806,8 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key, NIR_PASS(_, nir, nir_lower_vars_to_scratch, nir_var_function_temp, 256, glsl_get_natural_size_align_bytes, glsl_get_natural_size_align_bytes); - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, ~0); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, ~0); } /* Cleanup 8-bit math before lowering */ diff --git a/src/asahi/vulkan/hk_shader.c b/src/asahi/vulkan/hk_shader.c index c0adf1e4138..9d56ab63e5e 100644 --- a/src/asahi/vulkan/hk_shader.c +++ b/src/asahi/vulkan/hk_shader.c @@ -907,8 +907,8 @@ hk_lower_nir(struct hk_device *dev, nir_shader *nir, else if (nir->info.stage == MESA_SHADER_VERTEX) lower_indirect_modes |= nir_var_shader_in | nir_var_shader_out; - NIR_PASS(_, nir, nir_lower_indirect_derefs, lower_indirect_modes, - UINT32_MAX); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + lower_indirect_modes, UINT32_MAX); NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out, glsl_type_size, diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 9f6e284bcec..b058b293b4c 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -347,9 +347,10 @@ preprocess_nir(nir_shader *nir) /* Lower a bunch of stuff */ NIR_PASS(_, nir, nir_lower_var_copies); - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_shader_in, UINT32_MAX); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_in, UINT32_MAX); - NIR_PASS(_, nir, nir_lower_indirect_derefs, + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, nir_var_function_temp, 2); NIR_PASS(_, nir, nir_lower_array_deref_of_vec, diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 01077c95c25..7fd3f552bfa 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -184,7 +184,7 @@ else 'nir_lower_idiv.c', 'nir_lower_image.c', 'nir_lower_image_atomics_to_global.c', - 'nir_lower_indirect_derefs.c', + 'nir_lower_indirect_derefs_to_if_else_trees.c', 'nir_lower_input_attachments.c', 'nir_lower_int64.c', 'nir_lower_interpolation.c', diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 15c003751f1..6013fe77b38 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5161,11 +5161,12 @@ bool nir_lower_array_deref_of_vec(nir_shader *shader, nir_variable_mode modes, bool (*filter)(nir_variable *), nir_lower_array_deref_of_vec_options options); -bool nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes, - uint32_t max_lower_array_len); +bool nir_lower_indirect_derefs_to_if_else_trees(nir_shader *shader, + nir_variable_mode modes, + uint32_t max_lower_array_len); -bool nir_lower_indirect_var_derefs(nir_shader *shader, - const struct set *vars); +bool nir_lower_indirect_var_derefs_to_if_else_trees(nir_shader *shader, + const struct set *vars); bool nir_lower_locals_to_regs(nir_shader *shader, uint8_t bool_bitsize); diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs_to_if_else_trees.c similarity index 96% rename from src/compiler/nir/nir_lower_indirect_derefs.c rename to src/compiler/nir/nir_lower_indirect_derefs_to_if_else_trees.c index b29536ca287..2f65315c571 100644 --- a/src/compiler/nir/nir_lower_indirect_derefs.c +++ b/src/compiler/nir/nir_lower_indirect_derefs_to_if_else_trees.c @@ -228,8 +228,9 @@ lower_indirects_impl(nir_function_impl *impl, nir_variable_mode modes, * that does a binary search on the array index. */ bool -nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes, - uint32_t max_lower_array_len) +nir_lower_indirect_derefs_to_if_else_trees(nir_shader *shader, + nir_variable_mode modes, + uint32_t max_lower_array_len) { bool progress = false; @@ -243,7 +244,8 @@ nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes, /** Lowers indirects on any variables in the given set */ bool -nir_lower_indirect_var_derefs(nir_shader *shader, const struct set *vars) +nir_lower_indirect_var_derefs_to_if_else_trees(nir_shader *shader, + const struct set *vars) { bool progress = false; diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index c780af96d2e..ef6fe18e106 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -1261,8 +1261,8 @@ nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs) * The problem is that nir_lower_io_vars_to_temporaries doesn't handle TCS. */ if (nir->info.stage == MESA_SHADER_TESS_CTRL) { - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_shader_out, - UINT32_MAX); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_out, UINT32_MAX); } } diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c index 06dc66ef385..20c19da8480 100644 --- a/src/compiler/nir/nir_opt_loop_unroll.c +++ b/src/compiler/nir/nir_opt_loop_unroll.c @@ -557,9 +557,9 @@ wrapper_unroll(nir_loop *loop) * statements that are converted to a loop to take advantage of * exiting jump instruction handling. In this case we could make * use of a binary seach pattern like we do in - * nir_lower_indirect_derefs(), this should allow us to unroll the - * loops in an optimal way and should also avoid some of the - * register pressure that comes from simply nesting the + * nir_lower_indirect_derefs_to_if_else_trees(), this should allow us + * to unroll the loops in an optimal way and should also avoid some of + * the register pressure that comes from simply nesting the * terminators one after the other. */ if (list_length(&loop->info->loop_terminator_list) > 3) diff --git a/src/compiler/spirv/vtn_bindgen2.c b/src/compiler/spirv/vtn_bindgen2.c index ae2a9ae02bc..37d55dc4554 100644 --- a/src/compiler/spirv/vtn_bindgen2.c +++ b/src/compiler/spirv/vtn_bindgen2.c @@ -237,7 +237,8 @@ compile(void *memctx, const uint32_t *spirv, size_t spirv_size) bool scratch_lowered = false; NIR_PASS(scratch_lowered, nir, nir_lower_scratch_to_var); if (scratch_lowered) { - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, ~0); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, ~0); } /* Prune derefs/variables late, since scratch lowering leaves dead diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c index 41b744e9349..b71b18f5f23 100644 --- a/src/freedreno/ir3/ir3_nir.c +++ b/src/freedreno/ir3/ir3_nir.c @@ -514,14 +514,14 @@ ir3_nir_lower_io_vars_to_temporaries(nir_shader *s) /* Regardless of the above, we need to lower indirect references to * compact variables such as clip/cull distances because due to how * TCS<->TES IO works we cannot handle indirect accesses that "straddle" - * vec4 components. nir_lower_indirect_derefs has a special case for - * compact variables, so it will actually lower them even though we pass - * in 0 modes. + * vec4 components. nir_lower_indirect_derefs_to_if_else_trees has a special + * case for compact variables, so it will actually lower them even though we + * pass in 0 modes. * * Using temporaries would be slightly better but * nir_lower_io_vars_to_temporaries currently doesn't support TCS i/o. */ - NIR_PASS(_, s, nir_lower_indirect_derefs, 0, UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, 0, UINT32_MAX); } /** diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 6130903bc1a..b0c8cf18d8f 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -3889,7 +3889,8 @@ const void *nir_to_tgsi_options(struct nir_shader *s, * having matching declarations. */ if (s->info.stage == MESA_SHADER_FRAGMENT) { - NIR_PASS(_, s, nir_lower_indirect_derefs, nir_var_shader_in, UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_in, UINT32_MAX); NIR_PASS(_, s, nir_remove_dead_variables, nir_var_shader_in, NULL); } @@ -3899,7 +3900,7 @@ const void *nir_to_tgsi_options(struct nir_shader *s, */ if (s->info.stage == MESA_SHADER_TESS_CTRL || s->info.stage == MESA_SHADER_TESS_EVAL) { - NIR_PASS(_, s, nir_lower_indirect_derefs, 0 , UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, 0, UINT32_MAX); } NIR_PASS(_, s, nir_lower_io, nir_var_shader_in | nir_var_shader_out, @@ -3936,7 +3937,8 @@ const void *nir_to_tgsi_options(struct nir_shader *s, ntt_optimize_nir(s, screen, options); - NIR_PASS(_, s, nir_lower_indirect_derefs, no_indirects_mask, UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, + no_indirects_mask, UINT32_MAX); /* Lower demote_if to if (cond) { demote } because TGSI doesn't have a DEMOTE_IF. */ NIR_PASS(_, s, nir_lower_discard_if, nir_lower_demote_if_to_cf); diff --git a/src/gallium/drivers/crocus/crocus_screen.c b/src/gallium/drivers/crocus/crocus_screen.c index 14893758b9e..42d6a37b71b 100644 --- a/src/gallium/drivers/crocus/crocus_screen.c +++ b/src/gallium/drivers/crocus/crocus_screen.c @@ -170,7 +170,8 @@ crocus_init_shader_caps(struct crocus_screen *screen) /* Lie about these to avoid st/mesa's GLSL IR lowering of indirects, * which we don't want. Our compiler backend will check elk_compiler's - * options and call nir_lower_indirect_derefs appropriately anyway. + * options and call nir_lower_indirect_derefs_to_if_else_trees + * appropriately anyway. */ caps->indirect_temp_addr = true; caps->indirect_const_addr = true; diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index b7a08457329..4f45bfccc34 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -1273,7 +1273,8 @@ etna_compile_shader(struct etna_shader_variant *v) (nir_lower_io_options)0); NIR_PASS(_, s, nir_lower_vars_to_ssa); - NIR_PASS(_, s, nir_lower_indirect_derefs, nir_var_all, UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, nir_var_all, + UINT32_MAX); NIR_PASS(_, s, etna_nir_lower_texture, &v->key, v->shader->info); NIR_PASS(_, s, nir_lower_alu_width, alu_width_cb, NULL); diff --git a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c index 97656f21565..eabfb9ee27c 100644 --- a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c +++ b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c @@ -110,8 +110,8 @@ ir2_optimize_nir(nir_shader *s, bool lower) } OPT_V(s, nir_lower_vars_to_ssa); - OPT_V(s, nir_lower_indirect_derefs, nir_var_shader_in | nir_var_shader_out, - UINT32_MAX); + OPT_V(s, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_in | nir_var_shader_out, UINT32_MAX); if (lower) { OPT_V(s, ir3_nir_apply_trig_workarounds); diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 9f984f39fee..85618cdcd5a 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -215,7 +215,8 @@ iris_init_shader_caps(struct iris_screen *screen) /* Lie about these to avoid st/mesa's GLSL IR lowering of indirects, * which we don't want. Our compiler backend will check brw_compiler's - * options and call nir_lower_indirect_derefs appropriately anyway. + * options and call nir_lower_indirect_derefs_to_if_else_trees + * appropriately anyway. */ caps->indirect_temp_addr = true; caps->indirect_const_addr = true; diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index f7d175ee640..824803ebb28 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -1991,7 +1991,8 @@ nir_to_rc(struct nir_shader *s, struct pipe_screen *screen, * having matching declarations. */ if (s->info.stage == MESA_SHADER_FRAGMENT) { - NIR_PASS(_, s, nir_lower_indirect_derefs, nir_var_shader_in, UINT32_MAX); + NIR_PASS(_, s, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_in, UINT32_MAX); NIR_PASS(_, s, nir_remove_dead_variables, nir_var_shader_in, NULL); } diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 23b674629b9..4cac384653e 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -792,7 +792,8 @@ r600_lower_and_optimize_nir(nir_shader *sh, /**/ if (lower_64bit) - NIR_PASS(_, sh, nir_lower_indirect_derefs, nir_var_function_temp, 10); + NIR_PASS(_, sh, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, 10); NIR_PASS(_, sh, nir_opt_constant_folding); NIR_PASS(_, sh, nir_io_add_const_offset_to_base, io_modes); diff --git a/src/imagination/pco/pco_nir.c b/src/imagination/pco/pco_nir.c index 78d833111e1..0f7a4abcab1 100644 --- a/src/imagination/pco/pco_nir.c +++ b/src/imagination/pco/pco_nir.c @@ -586,7 +586,7 @@ void pco_preprocess_nir(pco_ctx *ctx, nir_shader *nir) NIR_PASS(_, nir, - nir_lower_indirect_derefs, + nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); @@ -605,7 +605,7 @@ void pco_preprocess_nir(pco_ctx *ctx, nir_shader *nir) NIR_PASS(_, nir, - nir_lower_indirect_derefs, + nir_lower_indirect_derefs_to_if_else_trees, nir_var_function_temp, UINT32_MAX); @@ -703,12 +703,12 @@ void pco_link_nir(pco_ctx *ctx, NIR_PASS(_, producer, - nir_lower_indirect_derefs, + nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); NIR_PASS(_, consumer, - nir_lower_indirect_derefs, + nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); diff --git a/src/intel/compiler/brw/brw_nir.c b/src/intel/compiler/brw/brw_nir.c index 28aca6795b9..17ff1a92f60 100644 --- a/src/intel/compiler/brw/brw_nir.c +++ b/src/intel/compiler/brw/brw_nir.c @@ -1412,7 +1412,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir, nir_variable_mode indirect_mask = brw_nir_no_indirect_mask(compiler, nir->info.stage); - OPT(nir_lower_indirect_derefs, indirect_mask, UINT32_MAX); + OPT(nir_lower_indirect_derefs_to_if_else_trees, indirect_mask, UINT32_MAX); /* Even in cases where we can handle indirect temporaries via scratch, we * it can still be expensive. Lower indirects on small arrays to @@ -1428,7 +1428,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir, * that one kerbal space program shader. */ if (!(indirect_mask & nir_var_function_temp)) - OPT(nir_lower_indirect_derefs, nir_var_function_temp, 16); + OPT(nir_lower_indirect_derefs_to_if_else_trees, nir_var_function_temp, 16); /* Lower array derefs of vectors for SSBO and UBO loads. For both UBOs and * SSBOs, our back-end is capable of loading an entire vec4 at a time and diff --git a/src/intel/compiler/elk/elk_nir.c b/src/intel/compiler/elk/elk_nir.c index 5217fb8f6b5..35b3f954440 100644 --- a/src/intel/compiler/elk/elk_nir.c +++ b/src/intel/compiler/elk/elk_nir.c @@ -1095,7 +1095,7 @@ elk_preprocess_nir(const struct elk_compiler *compiler, nir_shader *nir, nir_variable_mode indirect_mask = elk_nir_no_indirect_mask(compiler, nir->info.stage); - OPT(nir_lower_indirect_derefs, indirect_mask, UINT32_MAX); + OPT(nir_lower_indirect_derefs_to_if_else_trees, indirect_mask, UINT32_MAX); /* Even in cases where we can handle indirect temporaries via scratch, we * it can still be expensive. Lower indirects on small arrays to @@ -1111,7 +1111,7 @@ elk_preprocess_nir(const struct elk_compiler *compiler, nir_shader *nir, * that one kerbal space program shader. */ if (is_scalar && !(indirect_mask & nir_var_function_temp)) - OPT(nir_lower_indirect_derefs, nir_var_function_temp, 16); + OPT(nir_lower_indirect_derefs_to_if_else_trees, nir_var_function_temp, 16); /* Lower array derefs of vectors for SSBO and UBO loads. For both UBOs and * SSBOs, our back-end is capable of loading an entire vec4 at a time and @@ -1208,10 +1208,10 @@ elk_nir_link_shaders(const struct elk_compiler *compiler, * temporaries so we need to lower indirects on any of the * varyings we have demoted here. */ - NIR_PASS(_, producer, nir_lower_indirect_derefs, + NIR_PASS(_, producer, nir_lower_indirect_derefs_to_if_else_trees, elk_nir_no_indirect_mask(compiler, producer->info.stage), UINT32_MAX); - NIR_PASS(_, consumer, nir_lower_indirect_derefs, + NIR_PASS(_, consumer, nir_lower_indirect_derefs_to_if_else_trees, elk_nir_no_indirect_mask(compiler, consumer->info.stage), UINT32_MAX); diff --git a/src/intel/vulkan/anv_shader_compile.c b/src/intel/vulkan/anv_shader_compile.c index 629960c1903..c37537ef4be 100644 --- a/src/intel/vulkan/anv_shader_compile.c +++ b/src/intel/vulkan/anv_shader_compile.c @@ -1334,7 +1334,8 @@ anv_shader_lower_nir(struct anv_device *device, nir->info.cs.has_cooperative_matrix) { anv_fixup_subgroup_size(device, &nir->info); NIR_PASS(_, nir, brw_nir_lower_cmat, nir->info.api_subgroup_size); - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, 16); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, 16); } nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); diff --git a/src/kosmickrisp/compiler/nir_to_msl.c b/src/kosmickrisp/compiler/nir_to_msl.c index f1adce515b7..e9b5607a910 100644 --- a/src/kosmickrisp/compiler/nir_to_msl.c +++ b/src/kosmickrisp/compiler/nir_to_msl.c @@ -1875,7 +1875,7 @@ msl_preprocess_nir(struct nir_shader *nir) nir_var_function_temp | nir_var_shader_in | nir_var_shader_out); NIR_PASS(_, nir, nir_lower_alu_to_scalar, kk_scalarize_filter, NULL); - NIR_PASS(_, nir, nir_lower_indirect_derefs, + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); NIR_PASS(_, nir, nir_lower_vars_to_scratch, nir_var_function_temp, 0, glsl_get_natural_size_align_bytes, diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 88f45899002..0d264eb7992 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -539,7 +539,7 @@ st_link_glsl_to_nir(struct gl_context *ctx, (nir_variable_mode)0; if (mode) - nir_lower_indirect_derefs(nir, mode, UINT32_MAX); + nir_lower_indirect_derefs_to_if_else_trees(nir, mode, UINT32_MAX); } /* This needs to run after the initial pass of nir_lower_vars_to_ssa, so diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c index 351096caa31..8255229ce4a 100644 --- a/src/mesa/state_tracker/st_nir_lower_builtin.c +++ b/src/mesa/state_tracker/st_nir_lower_builtin.c @@ -246,7 +246,7 @@ st_nir_lower_builtin(nir_shader *shader) * be eliminated beforehand to avoid trying to lower one of those * builtins */ - progress |= nir_lower_indirect_var_derefs(shader, vars); + progress |= nir_lower_indirect_var_derefs_to_if_else_trees(shader, vars); if (nir_shader_intrinsics_pass(shader, lower_builtin_instr, nir_metadata_control_flow, NULL)) { diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 86e85a3b586..d084ff15eb6 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -6314,7 +6314,8 @@ optimize_nir(struct nir_shader *s, const struct nir_to_dxil_options *opts) do { progress = false; NIR_PASS(progress, s, nir_lower_vars_to_ssa); - NIR_PASS(progress, s, nir_lower_indirect_derefs, nir_var_function_temp, 4); + NIR_PASS(progress, s, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, 4); NIR_PASS(progress, s, nir_lower_alu_to_scalar, NULL, NULL); NIR_PASS(progress, s, nir_opt_copy_prop); NIR_PASS(progress, s, nir_opt_copy_prop_vars); diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 4a5f1379596..75f4920920e 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -1048,7 +1048,7 @@ nak_postprocess_nir(nir_shader *nir, nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); - OPT(nir, nir_lower_indirect_derefs, 0, UINT32_MAX); + OPT(nir, nir_lower_indirect_derefs_to_if_else_trees, 0, UINT32_MAX); if (nir->info.stage == MESA_SHADER_TESS_EVAL) { OPT(nir, nir_lower_tess_coord_z, @@ -1083,7 +1083,7 @@ nak_postprocess_nir(nir_shader *nir, break; case MESA_SHADER_FRAGMENT: - OPT(nir, nir_lower_indirect_derefs, + OPT(nir, nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); OPT(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out, type_size_vec4, nir_lower_io_lower_64bit_to_32_new | diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index f71567c3c55..7adcb388cc0 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -6219,7 +6219,8 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) NIR_PASS(_, nir, nir_lower_scratch_to_var); NIR_PASS(_, nir, nir_lower_vars_to_scratch, nir_var_function_temp, 256, vars_to_scratch_size_align_func, vars_to_scratch_size_align_func); - NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, ~0); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_function_temp, ~0); NIR_PASS(_, nir, nir_split_var_copies); NIR_PASS(_, nir, nir_lower_var_copies); diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 2f4f0b28130..e3b19b7fe22 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -914,7 +914,7 @@ panvk_lower_nir(struct panvk_device *dev, nir_shader *nir, /* Postprocess can add copies back in and lower_io can't handle them */ NIR_PASS(_, nir, nir_lower_var_copies); - NIR_PASS(_, nir, nir_lower_indirect_derefs, + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, nir_var_shader_in | nir_var_shader_out, UINT32_MAX); NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out, glsl_type_size, nir_lower_io_use_interpolated_input_intrinsics);