[Mesa-dev] [PATCH v4 038/129] nir: Support deref instructions in opt_undef

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Jun 1 11:41:31 UTC 2018


On Fri, Jun 1, 2018 at 7:02 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
> ---
>  src/compiler/nir/nir_opt_undef.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
> index b344377..1439ca9 100644
> --- a/src/compiler/nir/nir_opt_undef.c
> +++ b/src/compiler/nir/nir_opt_undef.c
> @@ -108,6 +108,7 @@ static bool
>  opt_undef_store(nir_intrinsic_instr *intrin)
>  {
>     switch (intrin->intrinsic) {
> +   case nir_intrinsic_store_deref:
>     case nir_intrinsic_store_var:
>     case nir_intrinsic_store_output:
>     case nir_intrinsic_store_per_vertex_output:

The value src is src1, not src0, for the store_deref instruction so we
check the wrong src for undef.

See https://github.com/BNieuwenhuizen/mesa/commit/e967c8706fd6be80abff80145c99a7f6b2e0f9e6
for a possible fix.

> @@ -133,8 +134,6 @@ nir_opt_undef(nir_shader *shader)
>     nir_builder b;
>     bool progress = false;
>
> -   nir_assert_lowered_derefs(shader, nir_lower_load_store_derefs);
> -
>     nir_foreach_function(function, shader) {
>        if (function->impl) {
>           nir_builder_init(&b, function->impl);
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list