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>
This commit is contained in:
@@ -41,6 +41,8 @@
|
||||
#include "ir_optimization.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class acp_entry : public exec_node
|
||||
{
|
||||
public:
|
||||
@@ -450,6 +452,8 @@ ir_constant_propagation_visitor::add_constant(ir_assignment *ir)
|
||||
this->acp->push_tail(entry);
|
||||
}
|
||||
|
||||
} /* unnamed namespace */
|
||||
|
||||
/**
|
||||
* Does a constant propagation pass on the code present in the instruction stream.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user