nir: Recognize trivial min/max.
authorMatt Turner <mattst88@gmail.com>
Wed, 6 May 2015 03:20:30 +0000 (20:20 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 7 May 2015 17:51:05 +0000 (10:51 -0700)
No changes, but does prevent some regressions in the next commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
src/glsl/nir/nir_opt_algebraic.py

index fda4bd5..42f4f47 100644 (file)
@@ -90,6 +90,12 @@ optimizations = [
    (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
    (('bcsel', ('inot', 'a@bool'), b, c), ('bcsel', a, c, b)),
    (('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),
+   (('fmin', a, a), a),
+   (('fmax', a, a), a),
+   (('imin', a, a), a),
+   (('imax', a, a), a),
+   (('umin', a, a), a),
+   (('umax', a, a), a),
    (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
    (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
    (('fsat', ('fsat', a)), ('fsat', a)),