[Mesa-dev] [PATCH 089/133] nir: Automatically update SSA if uses

Connor Abbott cwabbott0 at gmail.com
Wed Dec 17 17:42:36 PST 2014


Can we move this right after patch 53 (nir: Automatically handle SSA
uses when an instruction is inserted), since they're doing similar
things?

On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/glsl/nir/nir.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
> index 07d7b94..a4edc79 100644
> --- a/src/glsl/nir/nir.c
> +++ b/src/glsl/nir/nir.c
> @@ -1004,13 +1004,12 @@ update_if_uses(nir_cf_node *node)
>        return;
>
>     nir_if *if_stmt = nir_cf_node_as_if(node);
> -   if (if_stmt->condition.is_ssa)
> -      return;
>
> -   nir_register *reg = if_stmt->condition.reg.reg;
> -   assert(reg != NULL);
> +   struct set *if_uses_set = if_stmt->condition.is_ssa ?
> +                             if_stmt->condition.ssa->if_uses :
> +                             if_stmt->condition.reg.reg->uses;
>
> -   _mesa_set_add(reg->if_uses, _mesa_hash_pointer(if_stmt), if_stmt);
> +   _mesa_set_add(if_uses_set, _mesa_hash_pointer(if_stmt), if_stmt);
>  }
>
>  void
> --
> 2.2.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list