Module: Mesa
Branch: master
Commit: b3b170ade9cc3abe6b861a549292c9ec230844bc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3b170ade9cc3abe6b861a549292c9ec230844bc

Author: Jason Ekstrand <[email protected]>
Date:   Mon Jul 23 00:35:02 2018 -0700

nir: Add a couple of iand/ior optimizations

Spotted in a shader in Batman: Arkham City.

Reviewed-by: Timothy Arceri <[email protected]>

---

 src/compiler/nir/nir_opt_algebraic.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir_opt_algebraic.py 
b/src/compiler/nir/nir_opt_algebraic.py
index ba277fdfd0..7fc4ff1d40 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -377,6 +377,10 @@ optimizations = [
    (('ixor', a, a), 0),
    (('ixor', a, 0), a),
    (('inot', ('inot', a)), a),
+   (('ior', ('iand', a, b), b), b),
+   (('ior', ('ior', a, b), b), ('ior', a, b)),
+   (('iand', ('ior', a, b), b), b),
+   (('iand', ('iand', a, b), b), ('iand', a, b)),
    # DeMorgan's Laws
    (('iand', ('inot', a), ('inot', b)), ('inot', ('ior',  a, b))),
    (('ior',  ('inot', a), ('inot', b)), ('inot', ('iand', a, b))),

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to