nir: rename nir_lower_io_to_vector -> nir_opt_vectorize_io_vars

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35760>
This commit is contained in:
Marek Olšák 2025-06-25 17:52:51 -04:00 committed by Marge Bot
parent 944f8f6db2
commit 2aa94caf82
11 changed files with 18 additions and 18 deletions

View file

@ -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);
}
}

View file

@ -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){

View file

@ -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) {

View file

@ -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',

View file

@ -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,

View file

@ -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;

View file

@ -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;
}

View file

@ -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 &&

View file

@ -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

View file

@ -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);

View file

@ -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);