diff options
author | Eric Anholt <[email protected]> | 2015-01-26 16:48:48 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-01-29 11:44:06 -0800 |
commit | fc884eadf1fb188b7dea1a5c2f8ce37c6258e324 (patch) | |
tree | e8d6fab039d95df40105cc596e3651545235bf13 /src/glsl/nir | |
parent | 2b9c3bace78aaf0728e40b4b4cf7124e6a138696 (diff) |
nir: Add variants of some of the comparison simplifications.
We end up with these from TGSI-to-NIR because the pass generating the
comparisons doesn't know if the arg is actually a bool input or not. vc4
results:
total instructions in shared programs: 41801 -> 41508 (-0.70%)
instructions in affected programs: 4253 -> 3960 (-6.89%)
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-rw-r--r-- | src/glsl/nir/nir_opt_algebraic.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 9c62b283634..122555bb4f6 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt_algebraic.py @@ -71,6 +71,10 @@ optimizations = [ (('inot', ('fge', a, b)), ('flt', a, b)), (('inot', ('ilt', a, b)), ('ige', a, b)), (('inot', ('ige', a, b)), ('ilt', a, b)), + (('ine', ('flt', a, b), 0), ('flt', a, b)), + (('ine', ('fge', a, b), 0), ('fge', a, b)), + (('ine', ('ilt', a, b), 0), ('ilt', a, b)), + (('ine', ('ige', a, b), 0), ('ige', a, b)), (('flt', ('fadd', a, b), 0.0), ('flt', a, ('fneg', b))), (('fge', ('fadd', a, b), 0.0), ('fge', a, ('fneg', b))), (('feq', ('fadd', a, b), 0.0), ('feq', a, ('fneg', b))), |