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 <jason@jlekstrand.net>
This commit is contained in:
Timothy Arceri 2018-07-16 15:19:29 +10:00
parent c4188a9b9f
commit e105b0ca30
1 changed files with 3 additions and 0 deletions

View File

@ -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))