[Mesa-dev] [PATCH] radeonsi/nir: remove dead local variables

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 31 18:04:20 UTC 2019


On Thu, 31 Jan 2019 at 01:01, Timothy Arceri <tarceri at itsqueeze.com> wrote:
>
> Without this we do not end up with a deterministic NIR. NIR must
> be deterministic here because we use it to produce a sha for the
> radeonsi backends disk cache.
>
> This fixes the shader cache for a bunch of shaders.

I guess we'll need this for all branches since radeonsi started using
the nir lowerings and optimisations?

Fixes: 41d4016e061 ("radeonsi/nir: perform radeonsi-specific lowering
and optimization passes")

> ---
>  src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index 7554f5b9f8b..96096abe4ea 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -848,6 +848,9 @@ si_lower_nir(struct si_shader_selector* sel)
>         } while (progress);
>
>         NIR_PASS_V(sel->nir, nir_lower_bool_to_int32);
> +
> +       nir_variable_mode mask = nir_var_function_temp;
> +       nir_remove_dead_variables(sel->nir, mask);
Nit: I'd drop the temporary variable mask.

Regardless of the nit
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the mesa-dev mailing list