[Mesa-dev] [PATCH 038.1/129] FIXUP: nir: Support deref instructions in opt_undef
Jason Ekstrand
jason at jlekstrand.net
Tue Jun 5 00:54:27 UTC 2018
LGTM
On Sun, Jun 3, 2018 at 4:10 PM, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
wrote:
> ---
> src/compiler/nir/nir_opt_undef.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_
> undef.c
> index 1439ca9c165..e42a9af2bdf 100644
> --- a/src/compiler/nir/nir_opt_undef.c
> +++ b/src/compiler/nir/nir_opt_undef.c
> @@ -107,20 +107,24 @@ opt_undef_vecN(nir_builder *b, nir_alu_instr *alu)
> static bool
> opt_undef_store(nir_intrinsic_instr *intrin)
> {
> + int arg_index;
> switch (intrin->intrinsic) {
> case nir_intrinsic_store_deref:
> + arg_index = 1;
> + break;
> case nir_intrinsic_store_var:
> case nir_intrinsic_store_output:
> case nir_intrinsic_store_per_vertex_output:
> case nir_intrinsic_store_ssbo:
> case nir_intrinsic_store_shared:
> + arg_index = 0;
> break;
> default:
> return false;
> }
>
> - if (!intrin->src[0].is_ssa ||
> - intrin->src[0].ssa->parent_instr->type !=
> nir_instr_type_ssa_undef)
> + if (!intrin->src[arg_index].is_ssa ||
> + intrin->src[arg_index].ssa->parent_instr->type !=
> nir_instr_type_ssa_undef)
> return false;
>
> nir_instr_remove(&intrin->instr);
> --
> 2.17.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180604/7b51f34d/attachment-0001.html>
More information about the mesa-dev
mailing list