nir: Optimize (a*b)+(a*c) -> a*(b+c)
authorThomas Helland <thomashelland90@gmail.com>
Sat, 28 Feb 2015 19:32:31 +0000 (20:32 +0100)
committerMatt Turner <mattst88@gmail.com>
Wed, 11 Mar 2015 21:21:05 +0000 (14:21 -0700)
commit0525f2e851f5f6f53b5f83c8dcdfa48f9838133b
treeab5f79f276dc884bbe1c59fc3bd77caaf06190cf
parent09b03254091d054800834ddee604885a1093673f
nir: Optimize (a*b)+(a*c) -> a*(b+c)

Shader-db i965 instructions:
total instructions in shared programs: 1715894 -> 1710802 (-0.30%)
instructions in affected programs:     443080 -> 437988 (-1.15%)
helped:                                1502
HURT:                                  13
GAINED:                                4
LOST:                                  4

Shader-db NIR instructions:
total instructions in shared programs: 607710 -> 606187 (-0.25%)
instructions in affected programs:     208285 -> 206762 (-0.73%)
helped:                                769
HURT:                                  8
GAINED:                                0
LOST:                                  0

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
src/glsl/nir/nir_opt_algebraic.py