Module: Mesa Branch: main Commit: 3af5af429e0f40a78a9d0bac73e2175d41caa7a1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3af5af429e0f40a78a9d0bac73e2175d41caa7a1
Author: Faith Ekstrand <[email protected]> Date: Wed Nov 8 17:58:38 2023 -0600 nir: Optimize boolean ieq/ine with an immediate Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26120> --- 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 08f4099d98f..8a7cb3617fa 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -656,6 +656,10 @@ optimizations.extend([ (('fneu', ('b2f', 'a@1'), 0.0), a), (('ieq', ('b2i', 'a@1'), 0), ('inot', a)), (('ine', ('b2i', 'a@1'), 0), a), + (('ieq', 'a@1', False), ('inot', a)), + (('ieq', 'a@1', True), a), + (('ine', 'a@1', False), a), + (('ine', 'a@1', True), ('inot', a)), (('fneu', ('u2f', a), 0.0), ('ine', a, 0)), (('feq', ('u2f', a), 0.0), ('ieq', a, 0)),
