[Mesa-dev] [PATCH 07/10] nir: Add algebraic optimizations for pointless shifts.
Jason Ekstrand
jason at jlekstrand.net
Fri Jan 23 13:58:24 PST 2015
On Thu, Jan 22, 2015 at 9:09 AM, Matt Turner <mattst88 at gmail.com> wrote:
> On Thu, Jan 22, 2015 at 3:41 AM, Kenneth Graunke <kenneth at whitecape.org>
> wrote:
> > The GLSL IR optimization pass contained these; we may as well include
> > them too.
> >
> > No change in the number of NIR instructions on a shader-db run.
> >
> > total i965 instructions in shared programs: 6035397 -> 6035393 (-0.00%)
> > i965 instructions in affected programs: 772 -> 768 (-0.52%)
> > helped: 3 (all in glamor)
> >
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> > src/glsl/nir/nir_opt_algebraic.py | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/src/glsl/nir/nir_opt_algebraic.py
> b/src/glsl/nir/nir_opt_algebraic.py
> > index cf16b19..58e71e0 100644
> > --- a/src/glsl/nir/nir_opt_algebraic.py
> > +++ b/src/glsl/nir/nir_opt_algebraic.py
> > @@ -83,6 +83,13 @@ optimizations = [
> > # DeMorgan's Laws
> > (('iand', ('inot', a), ('inot', b)), ('inot', ('ior', a, b))),
> > (('ior', ('inot', a), ('inot', b)), ('inot', ('iand', a, b))),
> > + # Shift optimizations
> > + (('ishl', 0, a), 0),
>
> Shift zero by an unknown -> zero. Yes.
>
> > + (('ishl', a, 0), 0),
>
> Shift an unknown by zero -> zero?!
>
Yeah, that needs to be fixed
>
> With those fixed and shader-db results confirmed,
>
Same
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150123/a667a832/attachment.html>
More information about the mesa-dev
mailing list