On Mon, Oct 22, 2018 at 6:26 PM Ian Romanick <i...@freedesktop.org> wrote:

> On 10/22/2018 03:13 PM, Jason Ekstrand wrote:
> > These all assume the 0/~0 representation of booleans.  We'll turn them
> > back on before too long.
> > ---
> >  src/compiler/nir/nir_opt_algebraic.py | 5 -----
> >  1 file changed, 5 deletions(-)
> >
> > diff --git a/src/compiler/nir/nir_opt_algebraic.py
> b/src/compiler/nir/nir_opt_algebraic.py
> > index 8b24daddfdc..5a4e78e8e0e 100644
> > --- a/src/compiler/nir/nir_opt_algebraic.py
> > +++ b/src/compiler/nir/nir_opt_algebraic.py
> > @@ -436,9 +436,7 @@ optimizations = [
> >     (('imul', ('b2i', a), ('b2i', b)), ('b2i', ('iand', a, b))),
> >     (('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
> >     (('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),
> > -   (('iand', 'a@bool', 1.0), ('b2f', a), '!options->lower_b2f'),
> >     # True/False are ~0 and 0 in NIR.  b2i of True is 1, and -1 is ~0
> (True).
>
> Is this comment still true at the end of the series?  Should it also
> change?
>

It is still true but it doesn't apply to any of the optimizations that
follow.  I'll kill it off.


> > -   (('ineg', ('b2i@32', a)), a),
> >     (('flt', ('fneg', ('b2f', a)), 0), a), # Generated by TGSI KILL_IF.
> >     (('flt', ('fsub', 0.0, ('b2f', a)), 0), a), # Generated by TGSI
> KILL_IF.
> >     # Comparison with the same args.  Note that these are not done for
> > @@ -917,9 +915,6 @@ late_optimizations = [
> >     # we do these late so that we don't get in the way of creating ffmas
> >     (('fmin', ('fadd(is_used_once)', '#c', a), ('fadd(is_used_once)',
> '#c', b)), ('fadd', c, ('fmin', a, b))),
> >     (('fmax', ('fadd(is_used_once)', '#c', a), ('fadd(is_used_once)',
> '#c', b)), ('fadd', c, ('fmax', a, b))),
> > -
> > -   # Lowered for backends without a dedicated b2f instruction
> > -   (('b2f@32', a), ('iand', a, 1.0), 'options->lower_b2f'),
>
> I've never understood the point of this.  The backend should just
> generate the iand instruction as it's implementation of b2f.  This is
> what i965 does.  Converting the b2f at the late hour doesn't give any
> opportunities to enable other optimizations, so it seems pretty useless.
>

I don't really get it either but Alyssa wanted it.  Maybe we can can it
eventually once their back-end gets more mature?  In any case, it's not
hurting anything sitting here.

--Jason


> >  ]
> >
> >  print(nir_algebraic.AlgebraicPass("nir_opt_algebraic",
> optimizations).render())
> >
>
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to