summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_noop_swizzle.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-05-29 16:18:37 -0700
committerEric Anholt <[email protected]>2012-06-11 09:28:00 -0700
commit337d9c955b070224f7278524af54ddacd8bb0f17 (patch)
tree4235c18837cc1f81b0c2f008cc01ce7a6e3a39a8 /src/glsl/opt_noop_swizzle.cpp
parent279efce8bb7b6c802eb6c1de46971153ff6fdedb (diff)
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 <[email protected]>
Diffstat (limited to 'src/glsl/opt_noop_swizzle.cpp')
-rw-r--r--src/glsl/opt_noop_swizzle.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/opt_noop_swizzle.cpp b/src/glsl/opt_noop_swizzle.cpp
index 0a906aaf1da..693719e3dc7 100644
--- a/src/glsl/opt_noop_swizzle.cpp
+++ b/src/glsl/opt_noop_swizzle.cpp
@@ -35,6 +35,8 @@
#include "ir_print_visitor.h"
#include "glsl_types.h"
+namespace {
+
class ir_noop_swizzle_visitor : public ir_rvalue_visitor {
public:
ir_noop_swizzle_visitor()
@@ -46,6 +48,8 @@ public:
bool progress;
};
+} /* unnamed namespace */
+
void
ir_noop_swizzle_visitor::handle_rvalue(ir_rvalue **rvalue)
{