diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index cfe5b8be192..b2b5f85bddb 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -1236,7 +1236,7 @@ radv_link_shaders(const struct radv_device *device, struct radv_shader_stage *pr if (producer->info.stage == MESA_SHADER_TESS_CTRL || producer->info.stage == MESA_SHADER_MESH || (producer->info.stage == MESA_SHADER_VERTEX && has_geom_or_tess) || (producer->info.stage == MESA_SHADER_TESS_EVAL && merged_gs)) { - NIR_PASS(_, producer, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, producer, nir_opt_vectorize_io_vars, nir_var_shader_out); if (producer->info.stage == MESA_SHADER_TESS_CTRL) NIR_PASS(_, producer, nir_vectorize_tess_levels); @@ -1246,7 +1246,7 @@ radv_link_shaders(const struct radv_device *device, struct radv_shader_stage *pr if (consumer->info.stage == MESA_SHADER_GEOMETRY || consumer->info.stage == MESA_SHADER_TESS_CTRL || consumer->info.stage == MESA_SHADER_TESS_EVAL) { - NIR_PASS(_, consumer, nir_lower_io_to_vector, nir_var_shader_in); + NIR_PASS(_, consumer, nir_opt_vectorize_io_vars, nir_var_shader_in); } } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index b21c70962a4..a050a3b7c68 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -465,7 +465,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st NIR_PASS(_, nir, nir_split_per_member_structs); if (nir->info.stage == MESA_SHADER_FRAGMENT) - NIR_PASS(_, nir, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, nir, nir_opt_vectorize_io_vars, nir_var_shader_out); if (nir->info.stage == MESA_SHADER_FRAGMENT) NIR_PASS(_, nir, nir_lower_input_attachments, &(nir_input_attachment_options){ diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 070f9f28739..d977fc1f4a0 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -306,7 +306,7 @@ preprocess_nir(nir_shader *nir) NIR_PASS(_, nir, nir_lower_variable_initializers, nir_var_shader_out); if (nir->info.stage == MESA_SHADER_FRAGMENT) - NIR_PASS(_, nir, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, nir, nir_opt_vectorize_io_vars, nir_var_shader_out); if (nir->info.stage == MESA_SHADER_FRAGMENT) { NIR_PASS(_, nir, nir_lower_input_attachments, &(nir_input_attachment_options) { diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 5c4cb6f5c1d..e8ba5a6dc97 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -187,7 +187,6 @@ else 'nir_lower_io_arrays_to_elements.c', 'nir_lower_io_to_temporaries.c', 'nir_lower_io_to_scalar.c', - 'nir_lower_io_to_vector.c', 'nir_lower_io_vars_to_scalar.c', 'nir_lower_is_helper_invocation.c', 'nir_lower_multiview.c', @@ -295,6 +294,7 @@ else 'nir_opt_varyings.c', 'nir_opt_vectorize.c', 'nir_opt_vectorize_io.c', + 'nir_opt_vectorize_io_vars.c', 'nir_passthrough_gs.c', 'nir_passthrough_tcs.c', 'nir_phi_builder.c', diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index c7af9f801be..562af767b1d 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5313,7 +5313,7 @@ bool nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader, bool outputs_only); bool nir_lower_io_to_scalar(nir_shader *shader, nir_variable_mode mask, nir_instr_filter_cb filter, void *filter_data); bool nir_lower_io_vars_to_scalar(nir_shader *shader, nir_variable_mode mask); -bool nir_lower_io_to_vector(nir_shader *shader, nir_variable_mode mask); +bool nir_opt_vectorize_io_vars(nir_shader *shader, nir_variable_mode mask); bool nir_vectorize_tess_levels(nir_shader *shader); nir_shader *nir_create_passthrough_tcs_impl(const nir_shader_compiler_options *options, unsigned *locations, unsigned num_locations, diff --git a/src/compiler/nir/nir_lower_io_to_vector.c b/src/compiler/nir/nir_opt_vectorize_io_vars.c similarity index 98% rename from src/compiler/nir/nir_lower_io_to_vector.c rename to src/compiler/nir/nir_opt_vectorize_io_vars.c index 168ff903510..62356c49156 100644 --- a/src/compiler/nir/nir_lower_io_to_vector.c +++ b/src/compiler/nir/nir_opt_vectorize_io_vars.c @@ -26,7 +26,7 @@ #include "nir_builder.h" #include "nir_deref.h" -/** @file nir_lower_io_to_vector.c +/** @file nir_opt_vectorize_io_vars.c * * Merges compatible input/output variables residing in different components * of the same location. It's expected that further passes such as @@ -390,7 +390,7 @@ build_array_deref_of_new_var_flat(nir_shader *shader, } static bool -nir_lower_io_to_vector_impl(nir_function_impl *impl, nir_variable_mode modes) +nir_opt_vectorize_io_vars_impl(nir_function_impl *impl, nir_variable_mode modes) { assert(!(modes & ~(nir_var_shader_in | nir_var_shader_out))); @@ -579,12 +579,12 @@ nir_lower_io_to_vector_impl(nir_function_impl *impl, nir_variable_mode modes) } bool -nir_lower_io_to_vector(nir_shader *shader, nir_variable_mode modes) +nir_opt_vectorize_io_vars(nir_shader *shader, nir_variable_mode modes) { bool progress = false; nir_foreach_function_impl(impl, shader) { - progress |= nir_lower_io_to_vector_impl(impl, modes); + progress |= nir_opt_vectorize_io_vars_impl(impl, modes); } return progress; diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index d7d0a37e063..c56182367b6 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -2867,8 +2867,8 @@ tu_link_shaders(nir_shader **shaders, unsigned shaders_count) nir_lower_global_vars_to_local(consumer); } - NIR_PASS(_, producer, nir_lower_io_to_vector, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_vector, nir_var_shader_in); + NIR_PASS(_, producer, nir_opt_vectorize_io_vars, nir_var_shader_out); + NIR_PASS(_, consumer, nir_opt_vectorize_io_vars, nir_var_shader_in); consumer = producer; } diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 1ae5c7e9298..b01843a60dc 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1522,14 +1522,14 @@ brw_nir_link_shaders(const struct brw_compiler *compiler, } } - NIR_PASS(_, producer, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, producer, nir_opt_vectorize_io_vars, nir_var_shader_out); if (producer->info.stage == MESA_SHADER_TESS_CTRL && producer->options->vectorize_tess_levels) NIR_PASS_V(producer, nir_vectorize_tess_levels); NIR_PASS(_, producer, nir_opt_combine_stores, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_vector, nir_var_shader_in); + NIR_PASS(_, consumer, nir_opt_vectorize_io_vars, nir_var_shader_in); if (producer->info.stage != MESA_SHADER_TESS_CTRL && producer->info.stage != MESA_SHADER_MESH && diff --git a/src/intel/compiler/elk/elk_nir.c b/src/intel/compiler/elk/elk_nir.c index 0e9bc79581d..7a203b20c0a 100644 --- a/src/intel/compiler/elk/elk_nir.c +++ b/src/intel/compiler/elk/elk_nir.c @@ -1192,14 +1192,14 @@ elk_nir_link_shaders(const struct elk_compiler *compiler, elk_nir_optimize(consumer, c_is_scalar, devinfo); } - NIR_PASS(_, producer, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, producer, nir_opt_vectorize_io_vars, nir_var_shader_out); if (producer->info.stage == MESA_SHADER_TESS_CTRL && producer->options->vectorize_tess_levels) NIR_PASS_V(producer, nir_vectorize_tess_levels); NIR_PASS(_, producer, nir_opt_combine_stores, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_vector, nir_var_shader_in); + NIR_PASS(_, consumer, nir_opt_vectorize_io_vars, nir_var_shader_in); if (producer->info.stage != MESA_SHADER_TESS_CTRL) { /* Calling lower_io_to_vector creates output variable writes with diff --git a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c index 073ea0f1f3d..4acfeac8706 100644 --- a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c +++ b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c @@ -890,7 +890,7 @@ dxil_spirv_nir_passes(nir_shader *nir, { glsl_type_singleton_init_or_ref(); - NIR_PASS_V(nir, nir_lower_io_to_vector, + NIR_PASS_V(nir, nir_opt_vectorize_io_vars, nir_var_shader_out | (nir->info.stage != MESA_SHADER_VERTEX ? nir_var_shader_in : 0)); NIR_PASS_V(nir, nir_opt_combine_stores, nir_var_shader_out); diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 648f04e924e..00e2698ca46 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -391,7 +391,7 @@ panvk_preprocess_nir(UNUSED struct vk_physical_device *vk_pdev, { /* Ensure to regroup output variables at the same location */ if (nir->info.stage == MESA_SHADER_FRAGMENT) - NIR_PASS(_, nir, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, nir, nir_opt_vectorize_io_vars, nir_var_shader_out); NIR_PASS(_, nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, true);