nir: add an optimization to remove useless phi nodes
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 3 Feb 2015 06:49:44 +0000 (01:49 -0500)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 3 Feb 2015 21:00:13 +0000 (16:00 -0500)
commita135f340807139d874ae1d460009cf94786eb13a
tree1d6cd71b66477cdab8e36efb2bc64d3b027f02d4
parent572d1f6e41907096f21743181fd96eda82f51a79
nir: add an optimization to remove useless phi nodes

This removes phi nodes whose sources all point to the same thing.

Shader-db results:

total NIR instructions in shared programs: 2045293 -> 2041209 (-0.20%)
NIR instructions in affected programs:     126564 -> 122480 (-3.23%)
helped:                                615
HURT:                                  0

total FS instructions in shared programs: 4321840 -> 4320392 (-0.03%)
FS instructions in affected programs:     24622 -> 23174 (-5.88%)
helped:                                138
HURT:                                  0

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/Makefile.sources
src/glsl/nir/nir.h
src/glsl/nir/nir_opt_remove_phis.c [new file with mode: 0644]