[Mesa-dev] [PATCH 2/3] nir: remove unnecessary check when lowering to SSA

Jason Ekstrand jason at jlekstrand.net
Wed Apr 11 05:09:49 UTC 2018


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Tue, Apr 10, 2018 at 12:52 PM, Caio Marcelo de Oliveira Filho <
caio.oliveira at intel.com> wrote:

> Only fully-qualified direct derefs, collected in direct_deref_nodes,
> are checked for aliasing, so it is already known up front that they
> have only array derefs of type direct.
> ---
>  src/compiler/nir/nir_lower_vars_to_ssa.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c
> b/src/compiler/nir/nir_lower_vars_to_ssa.c
> index fe30c69756..4c41dd69cf 100644
> --- a/src/compiler/nir/nir_lower_vars_to_ssa.c
> +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
> @@ -298,15 +298,16 @@ deref_may_be_aliased_node(struct deref_node *node,
> nir_deref *deref,
>        switch (deref->child->deref_type) {
>        case nir_deref_type_array: {
>           nir_deref_array *arr = nir_deref_as_array(deref->child);
> -         if (arr->deref_array_type == nir_deref_array_type_indirect)
> -            return true;
> +
> +         /* This is a child of one of the derefs in direct_deref_nodes,
> +          * so we know it is direct.
> +          */
> +         assert(arr->deref_array_type == nir_deref_array_type_direct);
>
>           /* If there is an indirect at this level, we're aliased. */
>           if (node->indirect)
>              return true;
>
> -         assert(arr->deref_array_type == nir_deref_array_type_direct);
> -
>           if (node->children[arr->base_offset] &&
>               deref_may_be_aliased_node(node->children[arr->base_offset],
>                                         deref->child, state))
> --
> 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/20180410/3ca7a143/attachment.html>


More information about the mesa-dev mailing list