aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/loop_analysis.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-04 19:50:15 +0200
committermarha <marha@users.sourceforge.net>2014-07-04 19:50:15 +0200
commitfe03d6aef6338e43593f164b09ae993bcd0ecbdd (patch)
tree0fdb7e12fc82894e07b8b8141f2dbb00a93c60ad /mesalib/src/glsl/loop_analysis.cpp
parentcfc5bafcb2db8c6e05d7be6bb7315960be08c0d8 (diff)
downloadvcxsrv-fe03d6aef6338e43593f164b09ae993bcd0ecbdd.tar.gz
vcxsrv-fe03d6aef6338e43593f164b09ae993bcd0ecbdd.tar.bz2
vcxsrv-fe03d6aef6338e43593f164b09ae993bcd0ecbdd.zip
fontconfig mesa pixman xserver git update 4 July 2014
xserver commit a61ca6f006d70343c88fe45206fae0669d1e8971 pixman commit 6d2cf40166d81bfc63108504c8022dc4fec37ff5 fontconfig commit 5b22776999b6052afe0e829b1a0c0935bbe1e9f7 mesa commit 9a37eb8adb6558a4abf47774b583cb582a0ae116
Diffstat (limited to 'mesalib/src/glsl/loop_analysis.cpp')
-rw-r--r--mesalib/src/glsl/loop_analysis.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/mesalib/src/glsl/loop_analysis.cpp b/mesalib/src/glsl/loop_analysis.cpp
index 78ac30044..21d46ebce 100644
--- a/mesalib/src/glsl/loop_analysis.cpp
+++ b/mesalib/src/glsl/loop_analysis.cpp
@@ -227,8 +227,7 @@ loop_analysis::visit_enter(ir_call *)
/* Mark every loop that we're currently analyzing as containing an ir_call
* (even those at outer nesting levels).
*/
- foreach_list(node, &this->state) {
- loop_variable_state *const ls = (loop_variable_state *) node;
+ foreach_in_list(loop_variable_state, ls, &this->state) {
ls->contains_calls = true;
}
@@ -246,9 +245,7 @@ loop_analysis::visit(ir_dereference_variable *ir)
bool nested = false;
- foreach_list(node, &this->state) {
- loop_variable_state *const ls = (loop_variable_state *) node;
-
+ foreach_in_list(loop_variable_state, ls, &this->state) {
ir_variable *var = ir->variable_referenced();
loop_variable *lv = ls->get_or_insert(var, this->in_assignee);
@@ -288,10 +285,10 @@ loop_analysis::visit_leave(ir_loop *ir)
if (ls->contains_calls)
return visit_continue;
- foreach_list(node, &ir->body_instructions) {
+ foreach_in_list(ir_instruction, node, &ir->body_instructions) {
/* Skip over declarations at the start of a loop.
*/
- if (((ir_instruction *) node)->as_variable())
+ if (node->as_variable())
continue;
ir_if *if_stmt = ((ir_instruction *) node)->as_if();
@@ -303,9 +300,7 @@ loop_analysis::visit_leave(ir_loop *ir)
}
- foreach_list_safe(node, &ls->variables) {
- loop_variable *lv = (loop_variable *) node;
-
+ foreach_in_list_safe(loop_variable, lv, &ls->variables) {
/* Move variables that are already marked as being loop constant to
* a separate list. These trivially don't need to be tested.
*/
@@ -333,9 +328,7 @@ loop_analysis::visit_leave(ir_loop *ir)
do {
progress = false;
- foreach_list_safe(node, &ls->variables) {
- loop_variable *lv = (loop_variable *) node;
-
+ foreach_in_list_safe(loop_variable, lv, &ls->variables) {
if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1))
continue;
@@ -359,9 +352,7 @@ loop_analysis::visit_leave(ir_loop *ir)
/* The remaining variables that are not loop invariant might be loop
* induction variables.
*/
- foreach_list_safe(node, &ls->variables) {
- loop_variable *lv = (loop_variable *) node;
-
+ foreach_in_list_safe(loop_variable, lv, &ls->variables) {
/* If there is more than one assignment to a variable, it cannot be a
* loop induction variable. This isn't strictly true, but this is a
* very simple induction variable detector, and it can't handle more
@@ -402,8 +393,7 @@ loop_analysis::visit_leave(ir_loop *ir)
* Also figure out which terminator (if any) produces the smallest
* iteration count--this is the limiting terminator.
*/
- foreach_list(node, &ls->terminators) {
- loop_terminator *t = (loop_terminator *) node;
+ foreach_in_list(loop_terminator, t, &ls->terminators) {
ir_if *if_stmt = t->ir;
/* If-statements can be either 'if (expr)' or 'if (deref)'. We only care