<div dir="ltr"><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 15, 2018 at 10:19 PM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One of these was seen in a Deus Ex shader.<br>
<br>
V2: make opts more generic.<br>
<br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
---<br>
 src/compiler/nir/nir_opt_algebraic.py | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py<br>
index 0986dde6851..a9c2d821d7d 100644<br>
--- a/src/compiler/nir/nir_opt_algebraic.py<br>
+++ b/src/compiler/nir/nir_opt_algebraic.py<br>
@@ -286,6 +286,9 @@ optimizations = [<br>
    (('iand', ('uge(is_used_once)', a, b), ('uge', a, c)), ('uge', a, ('umax', b, c))),<br>
    (('iand', ('uge(is_used_once)', a, c), ('uge', b, c)), ('uge', ('umin', a, b), c)),<br>
<br>
+   (('ior', 'a@bool', ('ieq', a, False)), True),<br>
+   (('ior', 'a@bool', ('inot', a)), True),<br>
+<br>
    (('iand', ('ieq', 'a@32', 0), ('ieq', 'b@32', 0)), ('ieq', ('ior', 'a@32', 'b@32'), 0)),<br>
<br>
    # These patterns can result when (a < b || a < c) => (a < min(b, c))<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>