aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_variable_refcount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl/loops: replace loop controls with a normative bound.Paul Berry2013-12-091-21/+0
| | | | | | | | | | | | | | This patch replaces the ir_loop fields "from", "to", "increment", "counter", and "cmp" with a single integer ("normative_bound") that serves the same purpose. I've used the name "normative_bound" to emphasize the fact that the back-end is required to emit code to prevent the loop from running more than normative_bound times. (By contrast, an "informative" bound would be a bound that is informational only). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Teach ir_variable_refcount about ir_loop::counter variables.Paul Berry2013-11-291-0/+21
| | | | | | | | | | | | | | | | | If an ir_loop has a non-null "counter" field, the variable referred to by this field is implicitly read and written by the loop. We need to account for this in ir_variable_refcount, otherwise there is a danger we will try to dead-code-eliminate the loop counter variable. Note: at the moment the dead code elimination bug doesn't occur due to a bug in ir_hierarchical_visitor: it doesn't visit the "counter" field, so dead code elimination doesn't treat it as a candidate for elimination. But the patch to follow will fix that bug, so we need to fix ir_variable_refcount first in order to avoid breaking dead code elimination. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use the new hash table for the variable refcount visitor.Eric Anholt2012-12-071-7/+28
| | | | | | | Reviewed-by: Jordan Justen <[email protected]> [[email protected]: open_hash_table => hash_table] Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Rename class variable_entry to ir_variable_refcount_entry.Kenneth Graunke2012-01-301-7/+7
| | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-and-tested-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl2: move constructor into .cpp file to work around compiler bugBrian Paul2010-08-241-0/+12
| | | | | | | Fixes fd.o bug 29770 The refcount==0 assertion only failed on some systems. One example being 32-bit Linux with gcc 4.4.4.
* glsl: Add assert to check variable_entry referenced_count after construction.Vinson Lee2010-08-241-0/+1
| | | | | | | | | | A variable_entry after construction should have its referenced_count member set to 0. However, occassionally this isn't the case and entry->referenced_count has been observed to be a garbage value. This leads to crashes of several tests in the Piglit test suite. This patch adds an assert to check that a variable_entry instance has its referenced_count member initialized to 0 after construction.
* glsl2: Factor out the variable refcounting part of ir_dead_code.cpp.Eric Anholt2010-07-311-0/+100