On 16/07/18 14:25, Jason Ekstrand wrote:
How about just adding

(('ior', 'a@bool', ('ieq', a, 0)), True)

and maybe also

(('ior', 'a@bool', ('inot', a)), True)

while you're at it.

Ah yes that's much better. Will do.


--Jason

On Sun, Jul 15, 2018 at 4:27 PM Timothy Arceri <tarc...@itsqueeze.com <mailto:tarc...@itsqueeze.com>> wrote:

    One of these was seen in a Deus Ex shader.
    ---
      src/compiler/nir/nir_opt_algebraic.py | 3 +++
      1 file changed, 3 insertions(+)

    diff --git a/src/compiler/nir/nir_opt_algebraic.py
    b/src/compiler/nir/nir_opt_algebraic.py
    index 0986dde6851..682d498b79b 100644
    --- a/src/compiler/nir/nir_opt_algebraic.py
    +++ b/src/compiler/nir/nir_opt_algebraic.py
    @@ -286,6 +286,9 @@ optimizations = [
         (('iand', ('uge(is_used_once)', a, b), ('uge', a, c)), ('uge',
    a, ('umax', b, c))),
         (('iand', ('uge(is_used_once)', a, c), ('uge', b, c)), ('uge',
    ('umin', a, b), c)),

    +   (('ior', ('flt', a, b), ('ieq', ('flt', a, b), 0)), True),
    +   (('ior', ('fge', a, b), ('ieq', ('fge', a, b), 0)), True),
    +
         (('iand', ('ieq', 'a@32', 0), ('ieq', 'b@32', 0)), ('ieq',
    ('ior', 'a@32', 'b@32'), 0)),

         # These patterns can result when (a < b || a < c) => (a <
    min(b, c))
-- 2.17.1

    _______________________________________________
    mesa-dev mailing list
    mesa-dev@lists.freedesktop.org <mailto:mesa-dev@lists.freedesktop.org>
    https://lists.freedesktop.org/mailman/listinfo/mesa-dev

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to