[Mesa-dev] [PATCH 17/23] nir: Return progress from nir_lower_regs_to_ssa().
Matt Turner
mattst88 at gmail.com
Thu Mar 16 21:18:14 UTC 2017
And from nir_lower_regs_to_ssa_impl() as well.
---
src/compiler/nir/nir.h | 4 ++--
src/compiler/nir/nir_lower_regs_to_ssa.c | 12 ++++++++----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index d0e464a..ed4c2c9 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2388,8 +2388,8 @@ 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_impl(nir_function_impl *impl);
-void nir_lower_regs_to_ssa(nir_shader *shader);
+bool nir_lower_regs_to_ssa_impl(nir_function_impl *impl);
+bool nir_lower_regs_to_ssa(nir_shader *shader);
bool nir_lower_vars_to_ssa(nir_shader *shader);
bool nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes);
diff --git a/src/compiler/nir/nir_lower_regs_to_ssa.c b/src/compiler/nir/nir_lower_regs_to_ssa.c
index 095bae6..d70e702 100644
--- a/src/compiler/nir/nir_lower_regs_to_ssa.c
+++ b/src/compiler/nir/nir_lower_regs_to_ssa.c
@@ -210,11 +210,11 @@ rewrite_alu_instr(nir_alu_instr *alu, struct regs_to_ssa_state *state)
&vec->dest.dest.ssa);
}
-void
+bool
nir_lower_regs_to_ssa_impl(nir_function_impl *impl)
{
if (exec_list_is_empty(&impl->registers))
- return;
+ return false;
nir_metadata_require(impl, nir_metadata_block_index |
nir_metadata_dominance);
@@ -279,15 +279,19 @@ nir_lower_regs_to_ssa_impl(nir_function_impl *impl)
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ return true;
}
-void
+bool
nir_lower_regs_to_ssa(nir_shader *shader)
{
assert(exec_list_is_empty(&shader->registers));
+ bool progress = false;
nir_foreach_function(function, shader) {
if (function->impl)
- nir_lower_regs_to_ssa_impl(function->impl);
+ progress |= nir_lower_regs_to_ssa_impl(function->impl);
}
+
+ return progress;
}
--
2.10.2
More information about the mesa-dev
mailing list