From 337d9c955b070224f7278524af54ddacd8bb0f17 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 29 May 2012 16:18:37 -0700 Subject: 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 --- src/glsl/opt_structure_splitting.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/glsl/opt_structure_splitting.cpp') diff --git a/src/glsl/opt_structure_splitting.cpp b/src/glsl/opt_structure_splitting.cpp index a21238dd0aa..60eec53b72a 100644 --- a/src/glsl/opt_structure_splitting.cpp +++ b/src/glsl/opt_structure_splitting.cpp @@ -38,6 +38,8 @@ #include "ir_rvalue_visitor.h" #include "glsl_types.h" +namespace { + static bool debug = false; // XXX using variable_entry2 here to avoid collision (MSVC multiply-defined @@ -307,6 +309,8 @@ ir_structure_splitting_visitor::visit_leave(ir_assignment *ir) return visit_continue; } +} /* unnamed namespace */ + bool do_structure_splitting(exec_list *instructions) { -- cgit v1.2.3