<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 12:50 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">total instructions in shared programs: 8026509 -> 8026469 (-0.00%)<br>
instructions in affected programs:     6338 -> 6298 (-0.63%)<br>
helped:                                11<br></blockquote><div><br></div><div>Ignore those numbers. they're bogus.  Here are the real ones:<br><br>total instructions in shared programs: 5998321 -> 5998287 (-0.00%)<br>instructions in affected programs:     4520 -> 4486 (-0.75%)<br>helped:                                8<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/glsl/nir/nir_opt_algebraic.py | 5 +++++<br>
 1 file changed, 5 insertions(+)<br>
<br>
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py<br>
index 1dea42a..e3b309c 100644<br>
--- a/src/glsl/nir/nir_opt_algebraic.py<br>
+++ b/src/glsl/nir/nir_opt_algebraic.py<br>
@@ -117,6 +117,11 @@ optimizations = [<br>
    (('frcp', ('frcp', a)), a),<br>
    (('frcp', ('fsqrt', a)), ('frsq', a)),<br>
    (('frcp', ('frsq', a)), ('fsqrt', a)),<br>
+   # Boolean simplifications<br>
+   (('ine', 'a@bool', 0), 'a'),<br>
+   (('ieq', 'a@bool', 0), ('inot', 'a')),<br>
+   (('bcsel', 'a@bool', True, False), 'a'),<br>
+   (('bcsel', 'a@bool', False, True), ('inot', 'a')),<br>
<br>
 # This one may not be exact<br>
    (('feq', ('fadd', a, b), 0.0), ('feq', a, ('fneg', b))),<br>
<span class=""><font color="#888888">--<br>
2.2.2<br>
<br>
</font></span></blockquote></div><br></div></div>