aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_dead_functions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "glsl: Skip processing the first function's body in do_dead_functions()."Paul Berry2011-08-081-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opt_dead_functions contained a shortcut to skip processing the first function's body, based on the assumption that IR functions are topologically sorted, with callees always coming before their callers (therefore the first function cannot contain any calls). This assumption turns out not to be true in general. For example, the following code snippet gets translated to IR that violates this assumption: void f(); void g(); void f() { g(); } void g() { ... } In practice, the shortcut didn't cause bugs because of a coincidence of the circumstances in which opt_dead_functions is called: (a) we do inlining right before dead function elimination, and inlining (when successful) eliminates all calls. (b) for user-defined functions, inlining is always successful, because previous optimization passes (during compilation) have reduced them to a form that is eligible for inlining. (c) the function that appears first in the IR can't possibly call a built-in function, because built-in functions are always emitted before the function that calls them. It seems unnecessarily fragile to have opt_dead_functions depend on these coincidences. And the next patch in this series will break (c). So I'm reverting the shortcut. The consequence will be a slight increase in link time for complex shaders. This reverts commit c75427f4c8767e131e5fb3de44fbc9d904cb992d. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Skip processing the first function's body in do_dead_functions().Eric Anholt2011-03-151-1/+10
| | | | It can't call anything, so there's no point.
* glsl: Whitespace fixup in opt_dead_functions.cpp.Eric Anholt2011-03-151-106/+108
|
* Use C-style system headers in C++ code to avoid issues with std:: namespaceIan Romanick2011-02-211-2/+0
|
* glsl: Add using statements for standard library functions.Vinson Lee2011-02-031-0/+2
| | | | | | | | | | | | | 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.
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-2/+2
|
* glsl: Fix Doxygen tag \file in recently renamed filesChad Versace2010-11-171-1/+1
|
* glsl: Rename various ir_* files to lower_* and opt_*.Kenneth Graunke2010-11-151-0/+153
This helps distinguish between lowering passes, optimization passes, and other compiler code.