diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 222727d4f2a..3c78fc01a48 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1210,6 +1210,8 @@ optimizations.extend([ (('ior', a, True), True), (('ixor', a, a), 0), (('ixor', a, 0), a), + (('ixor', a, ('ixor', a, b)), b), + (('ixor', a, -1), ('inot', a)), (('inot', ('inot', a)), a), (('ior', ('iand', a, b), b), b), (('ior', ('ior', a, b), b), ('ior', a, b)), @@ -1222,6 +1224,7 @@ optimizations.extend([ (('ishl', 0, a), 0), (('ishl', a, 0), a), (('ishr', 0, a), 0), + (('ishr', -1, a), -1), (('ishr', a, 0), a), (('ushr', 0, a), 0), (('ushr', a, 0), a),