nir: Generalize the optimization of subs of subs from 0.
authorEric Anholt <eric@anholt.net>
Fri, 20 Feb 2015 08:00:27 +0000 (00:00 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 21 Feb 2015 22:57:14 +0000 (14:57 -0800)
commit4359954d842caa2a9f8d4b50d70ecc789884b68b
tree24e46fe696d1b1e629c35a5bf7c78a43dd96fbf1
parent345c2b288a5f49b82d505eb098847b8e53dde91f
nir: Generalize the optimization of subs of subs from 0.

I initially wrote this based on the "(('fneg', ('fneg', a)), a)" above,
but we can generalize it and make it more potentially useful.  In the
specific original case of a 0 for our new 'a' argument, it'll get further
algebraic optimization once the 0 is an argument to the new add.

No shader-db effects.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_opt_algebraic.py