glsl: Put a bunch of optimization visitors under anonymous namespaces.
authorEric Anholt <eric@anholt.net>
Tue, 29 May 2012 23:18:37 +0000 (16:18 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 11 Jun 2012 16:28:00 +0000 (09:28 -0700)
commit337d9c955b070224f7278524af54ddacd8bb0f17
tree4235c18837cc1f81b0c2f008cc01ce7a6e3a39a8
parent279efce8bb7b6c802eb6c1de46971153ff6fdedb
glsl: Put a bunch of optimization visitors under anonymous namespaces.

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>
15 files changed:
src/glsl/opt_algebraic.cpp
src/glsl/opt_constant_folding.cpp
src/glsl/opt_constant_propagation.cpp
src/glsl/opt_constant_variable.cpp
src/glsl/opt_copy_propagation.cpp
src/glsl/opt_copy_propagation_elements.cpp
src/glsl/opt_dead_code_local.cpp
src/glsl/opt_dead_functions.cpp
src/glsl/opt_function_inlining.cpp
src/glsl/opt_if_simplification.cpp
src/glsl/opt_noop_swizzle.cpp
src/glsl/opt_redundant_jumps.cpp
src/glsl/opt_structure_splitting.cpp
src/glsl/opt_swizzle_swizzle.cpp
src/glsl/opt_tree_grafting.cpp