summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_opt_algebraic.py
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-05-05 19:56:27 -0700
committerMatt Turner <[email protected]>2015-05-07 10:51:05 -0700
commit8ae559971a692b417acb9fec04386e1e95c619ec (patch)
tree3a690a17bec3d916f07ea4cc749c8780b93708cc /src/glsl/nir/nir_opt_algebraic.py
parent74697e2844a0850ef6b91fb4d34bfa3f6f4bff32 (diff)
nir: Recognize i2b(b2i(x)) as x.
Helps the same set of programs as the previous commit. instructions in affected programs: 4490 -> 4346 (-3.21%) helped: 8 Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_opt_algebraic.py')
-rw-r--r--src/glsl/nir/nir_opt_algebraic.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index 92928cf3a1d..fda4bd5b6ff 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -188,6 +188,7 @@ optimizations = [
(('fcsel', a, b, b), b),
# Conversions
+ (('i2b', ('b2i', a)), a),
(('f2i', ('ftrunc', a)), ('f2i', a)),
(('f2u', ('ftrunc', a)), ('f2u', a)),