summaryrefslogtreecommitdiff
path: root/src/glsl/opt_if_simplification.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-05-05glsl: Flip around "if" statements with empty "then" blocks.Eric Anholt1-1/+26
This cleans up some funny-looking code in some unigine shaders I was looking at. Also slightly helps on planeshift and a few shaders in an upcoming Valve release. total instructions in shared programs: 1653715 -> 1653587 (-0.01%) instructions in affected programs: 16550 -> 16422 (-0.77%) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-06-11glsl: Put a bunch of optimization visitors under anonymous namespaces.Eric Anholt1-0/+4
Because these classes are used entirely from their own source files and not from separate DSOs, the linker gets to produce massively less code. This cuts about 13k of text in the libdricore case. In the non-libdricore case, the additional linkage information allows the compiler to inline some code, so libglsl.a size actually increases by about 300 bytes. For a dricore build, improves shader_runner runtime on glsl-fs-copy-propagation-texcoords-1 by 0.21% +/- 0.03% (n=353574, outliers removed). No statistically significant difference with n=322 on glslparsertest on a yofrankie shader intended to test compiler performance. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13glsl: If an "if" has no "then" or "else" code left, remove it.Eric Anholt1-0/+8
Cuts 8/1068 instructions from glyphy's fragment shaders on i965. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-09glsl: Silence several "warning: unused parameter"Ian Romanick1-0/+1
2011-03-15glsl: Skip processing expression trees in do_if_simplification().Eric Anholt1-0/+10
Reduces time spent in this during glean texCombine by about 2/3.
2010-11-17glsl: Fix Doxygen tag \file in recently renamed filesChad Versace1-1/+1
2010-11-15glsl: Rename various ir_* files to lower_* and opt_*.Kenneth Graunke1-0/+84
This helps distinguish between lowering passes, optimization passes, and other compiler code.