nir: Add algebraic opt for no-op iand.
authorEric Anholt <eric@anholt.net>
Fri, 31 Jul 2015 16:12:48 +0000 (09:12 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 5 Aug 2015 00:19:25 +0000 (17:19 -0700)
I lazily generated some of these in VC4 NIR lowering.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/glsl/nir/nir_opt_algebraic.py

index 3068445cbfe862cc555d5fc0d4ad81dc1048e3e9..d7c17403f9f4186149971eee89312ee5c7c4f56a 100644 (file)
@@ -132,6 +132,7 @@ optimizations = [
    # Logical and bit operations
    (('fand', a, 0.0), 0.0),
    (('iand', a, a), a),
+   (('iand', a, ~0), a),
    (('iand', a, 0), 0),
    (('ior', a, a), a),
    (('ior', a, 0), a),