[Mesa-dev] [PATCH 12/12] nir/glsl: Propagate invariant into NIR alu ops

Jason Ekstrand jason at jlekstrand.net
Sat Mar 19 00:35:17 UTC 2016


On Fri, Mar 18, 2016 at 2:44 PM, Francisco Jerez <currojerez at riseup.net>
wrote:

> Jason Ekstrand <jason at jlekstrand.net> writes:
>
> > ---
> >  src/compiler/nir/glsl_to_nir.cpp | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/src/compiler/nir/glsl_to_nir.cpp
> b/src/compiler/nir/glsl_to_nir.cpp
> > index 613b138..f592c57 100644
> > --- a/src/compiler/nir/glsl_to_nir.cpp
> > +++ b/src/compiler/nir/glsl_to_nir.cpp
> > @@ -1048,6 +1048,8 @@ nir_visitor::visit(ir_assignment *ir)
> >  {
> >     unsigned num_components = ir->lhs->type->vector_elements;
> >
> > +   b.exact = ir->lhs->variable_referenced()->data.invariant;
> > +
>
> Wouldn't it make sense to set the exact flag for precise as well?
>

Thanks!  I meant to do that but it got lost somewhere in the rebase.  I'll
get it fixed up.

--Jason


> With that fixed:
>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
>
> >     if ((ir->rhs->as_dereference() || ir->rhs->as_constant()) &&
> >         (ir->write_mask == (1 << num_components) - 1 || ir->write_mask
> == 0)) {
> >        /* We're doing a plain-as-can-be copy, so emit a copy_var */
> > --
> > 2.5.0.400.gff86faf
> >
> > _______________________________________________
> > 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/20160318/46fdd219/attachment.html>


More information about the mesa-dev mailing list