summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_algebraic.py
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-07-16 15:19:29 +1000
committerTimothy Arceri <[email protected]>2018-07-18 09:53:27 +1000
commite105b0ca306eb826c7b5cbc8a965e9f774d0d5b7 (patch)
treecfd96c8703bc8d57d8b6a45e9009da89f46ad17d /src/compiler/nir/nir_opt_algebraic.py
parentc4188a9b9f45a2f2f9e3be99fe9861bec091b924 (diff)
nir: add a couple of ior opts to nir_opt_algebraic
One of these was seen in a Deus Ex shader. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_algebraic.py')
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 5e07d662b07..f49b43f3213 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -285,6 +285,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', 'a@bool', ('ieq', a, False)), True),
+ (('ior', 'a@bool', ('inot', a)), 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))