Lines Matching defs:loop

386 VTN_DECL_CF_NODE_FIND(loop)
396 struct vtn_loop *loop = vtn_cf_node_find_loop(cf_parent);
398 /* Detect a loop back-edge first. That way none of the code below
399 * accidentally operates on a loop back-edge.
401 if (loop && target_block == loop->header_block)
424 * to itself via a back-edge. That *should* get caught by the loop
425 * handling case above but if we have a back edge without a loop merge,
430 "a back-edge which is not to a loop header.");
445 * because it may also be a loop or switch break for an inner loop or
450 if (loop && target_block == loop->cont_block)
484 vtn_fail_if(target_block->merge_cf_node != &loop->node,
486 "nested loop level");
636 * are not to that construct's merge target are loop continues and
666 block->loop == NULL) {
672 struct vtn_loop *loop = rzalloc(b, struct vtn_loop);
674 loop->node.type = vtn_cf_node_type_loop;
675 loop->node.parent = cf_parent;
676 list_inithead(&loop->body);
677 list_inithead(&loop->cont_body);
678 loop->header_block = block;
679 loop->break_block = vtn_block(b, block->merge[1]);
680 loop->cont_block = vtn_block(b, block->merge[2]);
681 loop->control = block->merge[3];
683 list_addtail(&loop->node.link, cf_list);
684 block->loop = loop;
686 /* Note: The work item for the main loop body will start with the
688 * get here again and end up in an infinite loop. This is why we set
689 * block->loop above and check for it before creating one. This way,
690 * we only create the loop once and the second iteration that tries to
691 * handle this loop goes to the cases below and gets handled as a
694 vtn_add_cfg_work_item(b, work_list, &loop->node,
695 &loop->body, loop->header_block);
706 if (loop->cont_block != loop->header_block) {
707 vtn_add_cfg_work_item(b, work_list, &loop->node,
708 &loop->cont_body, loop->cont_block);
711 vtn_block_set_merge_cf_node(b, loop->break_block, &loop->node);
713 return loop->break_block;
843 /* Switch breaks as well as loop breaks and continues can be
1064 vtn_fail("Invalid loop control");
1188 nir_loop *loop = nir_push_loop(&b->nb);
1189 loop->control = vtn_loop_control(b, vtn_loop);
1195 * it at the beginning of the loop with a flag to ensure that
1201 b->nb.cursor = nir_before_cf_node(&loop->cf_node);
1204 b->nb.cursor = nir_before_cf_list(&loop->body);
1217 nir_pop_loop(&b->nb, loop);
1441 * - Continue blocks for loops get inserted before the body of the loop
1442 * but instructions in the continue may use SSA defs in the loop body.