vc4 was already cleaning these up, but it does shave 4 NIR instructions in
shader-db.
---
src/glsl/nir/nir_opt_algebraic.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/glsl/nir/nir_opt_algebraic.py
b/src/glsl/nir/nir_opt_algebraic.py
index b0c206a..dd4557f 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -146,6 +146,9 @@ optimizations = [
# next round of opt_algebraic, get picked up by one of the above two.
(('bcsel', '#a', b, c), ('bcsel', ('ine', 'a', 0), b, c)),
+ (('bcsel', a, b, b), b),
+ (('fcsel', a, b, b), b),
+
# Subtracts
(('fsub', 0.0, ('fsub', 0.0, a)), a),
(('isub', 0, ('isub', 0, a)), a),
--
2.1.4
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev