[Mesa-dev] [PATCH] nir/algebraic: Add optimizations for "a == a && a CMP b"
Jason Ekstrand
jason at jlekstrand.net
Tue Dec 20 17:33:07 UTC 2016
On Tue, Dec 20, 2016 at 12:49 AM, Gustaw Smolarczyk <wielkiegie at gmail.com>
wrote:
> 2016-12-20 6:32 GMT+01:00 Jason Ekstrand <jason at jlekstrand.net>:
> > This sequence shows up The Talos Principal, at least under Vulkan,
> > and prevents loop analysis from properly computing trip counts in a
> > few loops.
> > ---
> > src/compiler/nir/nir_opt_algebraic.py | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/src/compiler/nir/nir_opt_algebraic.py
> b/src/compiler/nir/nir_opt_algebraic.py
> > index 698ac67..cc70ad5 100644
> > --- a/src/compiler/nir/nir_opt_algebraic.py
> > +++ b/src/compiler/nir/nir_opt_algebraic.py
> > @@ -464,6 +464,14 @@ def bitfield_reverse(u):
> >
> > optimizations += [(bitfield_reverse('x at 32'), ('bitfield_reverse',
> 'x'))]
> >
> > +# For any comparison operation, "cmp", if you have "a != a && a cmp b"
> then
> > +# the "a != a" is redundant because it's equivalent to "a is not NaN"
> and, if
>
> Shouldn't the comment have a == a ?
>
Yes I did. Thanks for catching that. Fixed locally.
--Jason
> Regards,
> Gustaw
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161220/2d2896ba/attachment.html>
More information about the mesa-dev
mailing list