[Mesa-dev] [PATCH 02/12] nir: Take if uses into account in ssa_def_components_read

Jason Ekstrand jason at jlekstrand.net
Thu Jul 26 17:41:17 UTC 2018


On Thu, Jul 26, 2018 at 9:38 AM Caio Marcelo de Oliveira Filho <
caio.oliveira at intel.com> wrote:

> This patch as-is is
>
> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
>
> but consider the question below.
>
> On Thu, Jul 26, 2018 at 08:59:58AM -0700, Jason Ekstrand wrote:
> > Fixes: d800b7daa5440 "nir: Add a helper for figuring out what..."
> > ---
> >  src/compiler/nir/nir.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
> > index bc7f05b3e86..a849664134f 100644
> > --- a/src/compiler/nir/nir.c
> > +++ b/src/compiler/nir/nir.c
> > @@ -1446,6 +1446,9 @@ nir_ssa_def_components_read(const nir_ssa_def *def)
> >        }
> >     }
> >
> > +   if (!list_empty(&def->if_uses))
> > +      read_mask |= 1;
> > +
>
> If I understood correctly: if the 'def' has 'if_uses', then it will
> have only a single component. So maybe move this to be an early
> return?
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180726/3a459f1c/attachment.html>


More information about the mesa-dev mailing list