[Mesa-dev] [PATCH v2 1/4] nir: Rename convert_to_ssa lower_regs_to_ssa
Jason Ekstrand
jason at jlekstrand.net
Thu Dec 15 17:17:54 UTC 2016
This matches the naming of nir_lower_vars_to_ssa, the other to-SSA pass.
---
src/compiler/Makefile.sources | 2 +-
src/compiler/nir/nir.h | 4 +---
src/compiler/nir/{nir_to_ssa.c => nir_lower_regs_to_ssa.c} | 8 ++++----
src/gallium/drivers/freedreno/ir3/ir3_nir.c | 2 +-
src/gallium/drivers/vc4/vc4_program.c | 2 +-
src/mesa/drivers/dri/i965/brw_program.c | 2 +-
6 files changed, 9 insertions(+), 11 deletions(-)
rename src/compiler/nir/{nir_to_ssa.c => nir_lower_regs_to_ssa.c} (99%)
diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index 17b15de..33d6b2d 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -215,6 +215,7 @@ NIR_FILES = \
nir/nir_lower_io_types.c \
nir/nir_lower_passthrough_edgeflags.c \
nir/nir_lower_phis_to_scalar.c \
+ nir/nir_lower_regs_to_ssa.c \
nir/nir_lower_returns.c \
nir/nir_lower_samplers.c \
nir/nir_lower_system_values.c \
@@ -251,7 +252,6 @@ NIR_FILES = \
nir/nir_search_helpers.h \
nir/nir_split_var_copies.c \
nir/nir_sweep.c \
- nir/nir_to_ssa.c \
nir/nir_validate.c \
nir/nir_vla.h \
nir/nir_worklist.c \
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index ba88a24..f1c99ce 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2307,6 +2307,7 @@ nir_src *nir_get_io_vertex_index_src(nir_intrinsic_instr *instr);
bool nir_is_per_vertex_io(nir_variable *var, gl_shader_stage stage);
void nir_lower_io_types(nir_shader *shader);
+void nir_lower_regs_to_ssa(nir_shader *shader);
void nir_lower_vars_to_ssa(nir_shader *shader);
bool nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes);
@@ -2481,9 +2482,6 @@ bool nir_normalize_cubemap_coords(nir_shader *shader);
void nir_live_ssa_defs_impl(nir_function_impl *impl);
bool nir_ssa_defs_interfere(nir_ssa_def *a, nir_ssa_def *b);
-void nir_convert_to_ssa_impl(nir_function_impl *impl);
-void nir_convert_to_ssa(nir_shader *shader);
-
bool nir_repair_ssa_impl(nir_function_impl *impl);
bool nir_repair_ssa(nir_shader *shader);
diff --git a/src/compiler/nir/nir_to_ssa.c b/src/compiler/nir/nir_lower_regs_to_ssa.c
similarity index 99%
rename from src/compiler/nir/nir_to_ssa.c
rename to src/compiler/nir/nir_lower_regs_to_ssa.c
index e0998d4..74c1961 100644
--- a/src/compiler/nir/nir_to_ssa.c
+++ b/src/compiler/nir/nir_lower_regs_to_ssa.c
@@ -510,8 +510,8 @@ destroy_rewrite_state(rewrite_state *state)
ralloc_free(state->states);
}
-void
-nir_convert_to_ssa_impl(nir_function_impl *impl)
+static void
+lower_regs_to_ssa_impl(nir_function_impl *impl)
{
nir_metadata_require(impl, nir_metadata_dominance);
@@ -531,10 +531,10 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
}
void
-nir_convert_to_ssa(nir_shader *shader)
+nir_lower_regs_to_ssa(nir_shader *shader)
{
nir_foreach_function(function, shader) {
if (function->impl)
- nir_convert_to_ssa_impl(function->impl);
+ lower_regs_to_ssa_impl(function->impl);
}
}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index 2d86a52..336fa95 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -142,7 +142,7 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
}
OPT_V(s, nir_opt_global_to_local);
- OPT_V(s, nir_convert_to_ssa);
+ OPT_V(s, nir_lower_regs_to_ssa);
if (key) {
if (s->stage == MESA_SHADER_VERTEX) {
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 611c90d..ce2a962 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -2404,7 +2404,7 @@ vc4_shader_state_create(struct pipe_context *pctx,
}
NIR_PASS_V(s, nir_opt_global_to_local);
- NIR_PASS_V(s, nir_convert_to_ssa);
+ NIR_PASS_V(s, nir_lower_regs_to_ssa);
NIR_PASS_V(s, nir_normalize_cubemap_coords);
NIR_PASS_V(s, nir_lower_load_const_to_scalar);
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index a502b8e..f4df6c0 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -82,7 +82,7 @@ brw_create_nir(struct brw_context *brw,
nir_shader_get_entrypoint(nir), true, false);
} else {
nir = prog_to_nir(prog, options);
- NIR_PASS_V(nir, nir_convert_to_ssa); /* turn registers into SSA */
+ NIR_PASS_V(nir, nir_lower_regs_to_ssa); /* turn registers into SSA */
}
nir_validate_shader(nir);
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list