<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jul 26, 2018 at 9:38 AM Caio Marcelo de Oliveira Filho <<a href="mailto:caio.oliveira@intel.com">caio.oliveira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch as-is is<br>
<br>
Reviewed-by: Caio Marcelo de Oliveira Filho <<a href="mailto:caio.oliveira@intel.com" target="_blank">caio.oliveira@intel.com</a>><br>
<br>
but consider the question below.<br>
<br>
On Thu, Jul 26, 2018 at 08:59:58AM -0700, Jason Ekstrand wrote:<br>
> Fixes: d800b7daa5440 "nir: Add a helper for figuring out what..."<br>
> ---<br>
>  src/compiler/nir/nir.c | 3 +++<br>
>  1 file changed, 3 insertions(+)<br>
> <br>
> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c<br>
> index bc7f05b3e86..a849664134f 100644<br>
> --- a/src/compiler/nir/nir.c<br>
> +++ b/src/compiler/nir/nir.c<br>
> @@ -1446,6 +1446,9 @@ nir_ssa_def_components_read(const nir_ssa_def *def)<br>
>        }<br>
>     }<br>
>  <br>
> +   if (!list_empty(&def->if_uses))<br>
> +      read_mask |= 1;<br>
> +<br>
<br>
If I understood correctly: if the 'def' has 'if_uses', then it will<br>
have only a single component. So maybe move this to be an early<br>
return?<br></blockquote><div><br></div><div>I did think about that.  We could.  The loop above will usually return pretty quickly as well though.  I don't know if it matters.<br></div></div></div>