X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fglsl%2Floop_analysis.h;h=d6fdb908e0d668c88f063bdec92c42b5fd36998e;hb=1c2bf82d24a12c3a25c563ca601f0da859b767e7;hp=8f8240469451e43ca8968e26f4110e13f4e8af97;hpb=a40b3d5a3c6bbaec03bd6978c2e174d22998b0ed;p=mesa.git diff --git a/src/compiler/glsl/loop_analysis.h b/src/compiler/glsl/loop_analysis.h index 8f824046945..d6fdb908e0d 100644 --- a/src/compiler/glsl/loop_analysis.h +++ b/src/compiler/glsl/loop_analysis.h @@ -34,6 +34,13 @@ extern class loop_state * analyze_loop_variables(exec_list *instructions); +static inline bool +is_break(ir_instruction *ir) +{ + return ir != NULL && ir->ir_type == ir_type_loop_jump && + ((ir_loop_jump *) ir)->is_break(); +} + extern bool unroll_loops(exec_list *instructions, loop_state *ls, @@ -48,7 +55,7 @@ public: class loop_variable *get(const ir_variable *); class loop_variable *insert(ir_variable *); class loop_variable *get_or_insert(ir_variable *, bool in_assignee); - class loop_terminator *insert(ir_if *); + class loop_terminator *insert(ir_if *, bool continue_from_then); /** @@ -106,8 +113,7 @@ public: { this->num_loop_jumps = 0; this->contains_calls = false; - this->var_hash = _mesa_hash_table_create(NULL, _mesa_hash_pointer, - _mesa_key_pointer_equal); + this->var_hash = _mesa_pointer_hash_table_create(NULL); this->limiting_terminator = NULL; } @@ -203,6 +209,9 @@ public: * terminate the loop (if that is a fixed value). Otherwise -1. */ int iterations; + + /* Does the if continue from the then branch or the else branch */ + bool continue_from_then; };