Mesa (master): nir/algebraic: Generalize an optimization

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 22 21:00:28 UTC 2018


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri Oct 19 12:43:43 2018 -0500

nir/algebraic: Generalize an optimization

There's nothing boolean about (a | ~a) ~> -1

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

---

 src/compiler/nir/nir_opt_algebraic.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index cc747250ba..8b24daddfd 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -373,7 +373,7 @@ optimizations = [
    (('iand', ('uge(is_used_once)', a, c), ('uge', b, c)), ('uge', ('umin', a, b), c)),
 
    (('ior', 'a at bool', ('ieq', a, False)), True),
-   (('ior', 'a at bool', ('inot', a)), True),
+   (('ior', a, ('inot', a)), -1),
 
    (('iand', ('ieq', 'a at 32', 0), ('ieq', 'b at 32', 0)), ('ieq', ('ior', 'a at 32', 'b at 32'), 0)),
 




More information about the mesa-commit mailing list