History log of /external/mesa3d/src/glsl/opt_tree_grafting.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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_tree_grafting.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_tree_grafting.cpp
d884f60861f270cdcf7d9d47765efcf1e1de30b6 20-Mar-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Convert ir_call to be a statement rather than a value.

Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
stream, treating it as an untyped statement. Yet, it was a subclass
of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
arbitrary expression trees. While this fit naturally with the source
language, it meant that expressions might not be pure, making it
difficult to transform and optimize them. To combat this, we always
emitted ir_call directly in the RHS of an ir_assignment, only using
a temporary variable in expression trees. Many passes relied on this
assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue). Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one. They cannot be embedded in expressions.

All expression trees are now pure, without exception.

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_tree_grafting.cpp
e3b520049675f78065eccbc25c001ea77861c129 29-Jan-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Rename class variable_entry to ir_variable_refcount_entry.

Exporting a publicly visible class with a generic name like
"variable_entry" via ir_variable_refcount.h is kind of mean.

Many IR transformers would like to define their own "variable_entry"
class. If they accidentally include this header, the compiler/linker
may get confused and try to instantiate the wrong variable_entry class,
leading to bizarre runtime crashes.

The hope is that renaming this one will allow .cpp files to safely
declare and use their own file-scope "variable_entry" classes.

This avoids crashes caused by converting src/glsl to automake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
3c22e3516527ccb83f2667abfa0e6518c5938df8 23-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Stop tree grafting if a variable is overwritten as an 'out' param.

While reviewing some compiler cleanups I'd sent out, Paul noticed that
tree grafting wasn't taking "out" parameters into account.

Further investigation revealed that it isn't strictly necessary: ir_call
ends basic blocks, and tree grafting currently only operates on basic
blocks. So calls already kill grafts.

However, just to be safe, this patch makes "out" parameters explicitly
kill grafts. Paul and I both prefer this. It's a bit clearer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
1e3bcbdf31f09666ba358f35ff9486faee3642ca 25-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Add a new ir_txs (textureSize) opcode to ir_texture.

One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f 10-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> Use C-style system headers in C++ code to avoid issues with std:: namespace
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
61c59234f916406512b3591f46599cc29a5d8e23 04-Feb-2011 Vinson Lee <vlee@vmware.com> glsl: Add using statements for standard library functions.

Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
819d57fce94b20fa0d34da6f037f0a53c4a5bdc2 13-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Introduce a new "const_in" variable mode.

This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions. The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
c5a27b5939427bdc95c926b450ed3de1ff4baafb 09-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Change texel offsets to a single vector rvalue.

Having these as actual integer values makes it difficult to implement
the texture*Offset built-in functions, since the offset is actually a
function parameter (which doesn't have a constant value).

The original rationale was that some hardware needs these offset baked
into the instruction opcode. However, at least i965 should be able to
support non-constant offsets. Others should be able to rely on inlining
and constant propagation.
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
df883eb1575a740bf91e01cbe2eaa4dbc1f9f154 17-Nov-2010 Chad Versace <chad.versace@intel.com> glsl: Fix Doxygen tag \file in recently renamed files
/external/mesa3d/src/glsl/opt_tree_grafting.cpp
32aaf89823de11e98cb59d5ec78c66cd3e74bcd4 15-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Rename various ir_* files to lower_* and opt_*.

This helps distinguish between lowering passes, optimization passes, and
other compiler code.
/external/mesa3d/src/glsl/opt_tree_grafting.cpp