History log of /external/mesa3d/src/glsl/ir_expression_flattening.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/ir_expression_flattening.cpp
ced54dcf9b496dbe0bf254673ecee37014c1ee3b 13-Mar-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Comment that expression flattening is used for matrix operations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
d3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 21-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> Convert everything from the talloc API to the ralloc API.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
9fd2a8d6923a8a7218a714622586bb1dbaaebad5 26-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Move ir_expression_flattening to using the rvalue visitor class.

The previous implementation was missing handling of some rvalues, such
as "if" conditions, leading to glsl-mat-int-from-ctor-* not getting
caught.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
c7a18da69022d3f9b05c21ff2473e8ea390f77f1 20-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> glsl2: Replace insert_before/remove pairs with exec_node::replace_with.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
7e2aa91507a5883e33473e0a94215ee3985baad1 20-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Add and use new variable mode ir_var_temporary

This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken. The big changes
are:

* Add the ir_var_temporary variable mode

* Change the ir_variable constructor to take the mode as a
parameter and correctly specify the mode for all ir_varables.

* Change the linker to not cross validate ir_var_temporary
variables.

* Change the linker to pull all ir_var_temporary variables from
global scope into 'main'.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
562c3d0cb1aedbf3c9f13f206678fa3f0fa26a9f 13-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Flatten expression that appear as the parameters of ir_call as well.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
94da2abfd49c6b4060544986ef68d5662b1cc292 13-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Flatten expressions that appear as the children of ir_return as well.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
d74c9ff046c9cf8ee33c202eb5eba3dfc7f8e06e 13-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Use a better talloc context for ir_expression_flattening.

The instruction can be hung off of any other in the tree, even if the
other one will be deleted, since it'll get stolen to the shader's
context later if it's still live.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
5723e5bb8b73cd2a3b77d750972e3d0b4d0d0ff8 12-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Flatten out expressions that are the child of an assignment rhs.

This feels a little odd, but it will be useful for ir_mat_to_vec,
where I want to see a plain assignment of the expression to a
variable, not to a writemasked array dereference with a call as the
array index.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp
29285882676388aacff123e8bdf025904abf8ea9 25-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Move the compiler to the subdirectory it will live in in Mesa.
/external/mesa3d/src/glsl/ir_expression_flattening.cpp