nir/opt_algebraic: optimizations for add umax/umin with zero
authorGert Wollny <gert.wollny@collabora.com>
Sun, 2 May 2021 21:48:05 +0000 (23:48 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Tue, 4 May 2021 07:33:32 +0000 (09:33 +0200)
commita1996976425090c75127ea908b27a2bf79b73711
tree505c5a86b5b5ce7a6db56a4e35c31f37758dec1f
parent301ceab7ce2c9afd86fb2870d0a05a0ef030b9fd
nir/opt_algebraic: optimizations for add umax/umin with zero

For unsigned comparisons with zero these ops can be eliminated.

v2: Add comparison optimizations with -1 (Rhys Perry)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10583>
src/compiler/nir/nir_opt_algebraic.py