summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_basic_block.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Use typed foreach_in_list instead of foreach_list.Matt Turner2014-07-011-5/+2
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glsl: Remove unused include from ir_basic_block.cppThomas Helland2014-06-101-2/+0
| | | | | | | | Found with IWYU. Compile-tested on my Ivy-bridge system. Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Thomas Helland <[email protected]>
* glsl: Convert piles of foreach_iter to the newer foreach_list macro.Kenneth Graunke2014-01-131-6/+4
| | | | | | | | | | | | | foreach_iter and exec_list_iterators have been deprecated for some time now; we just hadn't ever bothered to convert code to the newer foreach_list and foreach_list_safe macros. In these cases, we aren't editing the list, so we can use foreach_list rather than foreach_list_safe. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Teach basic block analysis about break/continue/discard.Paul Berry2013-04-241-1/+1
| | | | | | | | | | | | | Previously, the only kind of ir_jump that would terminate a basic block was "return". However, the other possible types of ir_jump ("break", "continue", and "discard") should terminate a basic block too. This patch modifies basic block analysis so that it terminates a basic block on any type of ir_jump, not just ir_return. Fixes piglit test dead-code-break-interaction.shader_test. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Convert ir_call to be a statement rather than a value.Kenneth Graunke2012-04-021-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl2: Don't dead-code eliminate a call where the return value is unused.Eric Anholt2010-08-051-4/+9
| | | | | | | | This showed up since the disabling of inlining at compile time, which I apparently didn't regenerate piglit summary for. Fixes: glsl-deadcode-call.
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+144