Lines Matching defs:loop
32 * 3. Replace all "break" with a single conditional one at the end of the loop
42 * Continues are lowered by adding a per-loop "execute flag", initialized to
43 * true, that when cleared inhibits all execution until the end of the loop.
46 * at the end of the loop, and trigger the unique "break".
54 * a dummy loop and using break.
98 ir_loop* loop;
112 this->loop = p_loop;
122 /* also supported for the "function loop" */
124 exec_list& list = this->loop ? this->loop->body_instructions : signature->body;
134 assert(this->loop);
137 this->loop->insert_before(this->break_flag);
138 this->loop->insert_before(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(break_flag), new(this->signature) ir_constant(false), 0));
186 struct loop_record loop;
265 assert(this->loop.loop);
267 if(ir->get_next()->is_tail_sentinel() && (this->loop.nesting_depth == 0
268 || (this->loop.nesting_depth == 1 && this->loop.in_if_at_the_end_of_the_loop)))
298 if(this->loop.nesting_depth == 0 && ir->get_next()->is_tail_sentinel())
299 this->loop.in_if_at_the_end_of_the_loop = true;
302 ++this->loop.nesting_depth;
379 this->loop.may_set_return_flag = true;
380 if(this->loop.loop) {
392 * In the lowered code, we instead put the break check between the this->loop body and the increment,
398 jumps[lower]->insert_before(new(ir) ir_assignment(new (ir) ir_dereference_variable(this->loop.get_break_flag()), new (ir) ir_constant(true), 0));
402 ir_variable* execute_flag = this->loop.get_execute_flag();
468 if(ir_if_cond_deref && ir_if_cond_deref->var == this->loop.execute_flag) {
483 assert(this->loop.execute_flag);
484 ir_if* if_execute = new(ir) ir_if(new(ir) ir_dereference_variable(this->loop.execute_flag));
490 --this->loop.nesting_depth;
497 loop_record saved_loop = this->loop;
498 this->loop = loop_record(this->function.signature, ir);
503 /* FINISHME: turn the this->loop into an if, or replace it with its body */
506 if(this->loop.break_flag) {
507 ir_if* break_if = new(ir) ir_if(new(ir) ir_dereference_variable(this->loop.break_flag));
512 if(this->loop.may_set_return_flag) {
516 if(saved_loop.loop)
523 this->loop = saved_loop;
531 assert(!this->loop.loop);
534 loop_record saved_loop = this->loop;
536 this->loop = loop_record(ir);
538 assert(!this->loop.loop);
544 this->loop = saved_loop;