From: Eric Anholt Date: Thu, 29 Jan 2015 23:50:18 +0000 (-0800) Subject: nir: Add a couple of simplifications of csel operations. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc982f4a859d800ec3eba95d3c55bbe6af8d6518;p=mesa.git nir: Add a couple of simplifications of csel operations. vc4 was already cleaning these up, but it does shave 4 NIR instructions in shader-db. Reviewed-by: Matt Turner Reviewed-by: Connor Abbott --- diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 504c9f69054..ef3a0297457 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt_algebraic.py @@ -145,6 +145,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),