From: Matt Turner Date: Fri, 24 Feb 2017 23:22:54 +0000 (-0800) Subject: nir: Return progress from nir_lower_vars_to_ssa(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c597f87739bae7d0d386381417a0aba6bbc39fe2;p=mesa.git nir: Return progress from nir_lower_vars_to_ssa(). Reviewed-by: Jason Ekstrand --- diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 1f918af725d..910352dba07 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2391,7 +2391,7 @@ 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); -void nir_lower_vars_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); bool nir_lower_constant_initializers(nir_shader *shader, diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c index 37a786cbacd..e5a12eb9713 100644 --- a/src/compiler/nir/nir_lower_vars_to_ssa.c +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c @@ -737,11 +737,15 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl) return progress; } -void +bool nir_lower_vars_to_ssa(nir_shader *shader) { + bool progress = false; + nir_foreach_function(function, shader) { if (function->impl) - nir_lower_vars_to_ssa_impl(function->impl); + progress |= nir_lower_vars_to_ssa_impl(function->impl); } + + return progress; }