337d9c955b070224f7278524af54ddacd8bb0f17 |
|
30-May-2012 |
Eric Anholt <eric@anholt.net> |
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>
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
2d75a1e25e6ddcd65964d30fc3c782df2e880cc4 |
|
30-Apr-2012 |
Vinson Lee <vlee@freedesktop.org> |
glsl: Initialize member variable in ir_copy_propagation_elements_visitor. Fix uninitialized scalar field defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
82065fa20ee3f2880a070f1f4f75509b910cedde |
|
21-Sep-2011 |
Kenneth Graunke <kenneth@whitecape.org> |
glsl: Remove ir_call::get_callee() and set_callee(). Previously, set_callee() performed some assertions about the type of the ir_call; protecting the bare pointer ensured these checks would be run. However, ir_call no longer has a type, so the getter and setter methods don't actually do anything useful. Remove them in favor of accessing callee directly, as is done with most other fields in our IR. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
057f9ae54b5efb0020cc0c049d50e778de3f3f7a |
|
09-Jan-2012 |
Eric Anholt <eric@anholt.net> |
glsl: Fix copy_propagation_elements bug in handling self-copies. We were doing the kill of the updated channels, then adding our copy to the list of available stuff to copy. But if the copy was updating its own source channels, we didn't notice, breaking this code: R0.xyzw = arg0 + arg1; R0.xyzw = R0.wwwx; gl_FragColor.xyzw = clamp(R0.xyzw, 0.0, 1.0); Fixes piglit glsl-copy-propagation-self-2. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
6c29452f38dacace4f234e9526bfdc1e23fb5051 |
|
06-Jan-2012 |
Andy Clayton <q3aiml@gmail.com> |
glsl: fix glsl optimization infinite loop from copy_propagation_elements The trick was to produce an assignment in the IR along the lines of: (assign (xyzw) (var_ref R0) (swiz wwww (var_ref R0) )) which occurs only rarely even in code that looks like it should do this, because of the assignment temporaries generated in ast_to_hir. From the IR above, this optimization pass would then propagate references of R0 into R0.wwww (seems reasonable), but without this patch, a later reference of R0.wwww would see R0 first, turning that into R0.wwww.wwww, which triggered opt_swizzle_swizzle, and then we looped back to this code to do it again. Avoid that by skipping over the usual ir_rvalue visitor's ir_swizzle hook, so that we get handle_rvalue() on the ir_swizzle itself, not its referenced value. Looking at only the swizzle will always optimize away at least as much as looking at the swizzle's refererenced value. We now still claim to propagate r0.w into r0.w, but at least we don't trigger the loop. v2: Rewrite commit message (changes by anholt) Fixes piglit glsl-copy-propagation-self-1 Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34006
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
909bd476ca65035b93399c7b95f7118b1cded3f2 |
|
08-Apr-2011 |
Eric Anholt <eric@anholt.net> |
glsl/opt_cpe: Fix a crash when a kill kills for two reasons. Fixes glsl-copy-propagation-loop-2 when this optimization pass is re-enabled. Reported-by: David Lamparter <equinox@diac24.net>
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
487debfda56ad3855db655688186401b0dd75233 |
|
03-Apr-2011 |
Eric Anholt <eric@anholt.net> |
glsl/opt_cpe: Kill when the assignment isn't something we recognize. A few GLES2 tests tripped over this when using array dereferences to hit channels on the LHS (see piglit test glsl-copy-propagation-vector-indexing). We wouldn't find the ir_dereference_variable, and assume that that meant that it wasn't an assignment to a scalar/vector, and thus not notice that the variable had been changed.
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
29a2e9133e415de8b010df5b80db758aaf1007a6 |
|
29-Jan-2011 |
Eric Anholt <eric@anholt.net> |
glsl: Remove extra checks for constant true assignment conditions. These are already stripped by opt_constant_folding.cpp.
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|
e31266ed3e3667c043bc5ad1abd65cfdb0fa7fdb |
|
25-Jan-2011 |
Eric Anholt <eric@anholt.net> |
glsl: Add a new opt_copy_propagation variant that does it channel-wise. This patch cleans up many of the extra copies in GLSL IR introduced by i965's scalarizing passes. It doesn't result in a statistically significant performance difference on nexuiz high settings (n=3) or my demo (n=10), due to brw_fs.cpp's register coalescing covering most of those extra moves anyway. However, it does make the debug of wine's GLSL shaders much more tractable, and reduces instruction count of glsl-fs-convolution-2 from 376 to 288.
/external/mesa3d/src/glsl/opt_copy_propagation_elements.cpp
|